Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
198738d8
Commit
198738d8
authored
6 months ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
pgsql.backup - no subshell to fetch backup status
parent
468cadb7
No related branches found
No related tags found
1 merge request
!150
pgsql.backup - no subshell to fetch backup status
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/localdump/pgsql.sh
+49
-50
49 additions, 50 deletions
plugins/localdump/pgsql.sh
with
49 additions
and
50 deletions
plugins/localdump/pgsql.sh
+
49
−
50
View file @
198738d8
...
@@ -56,7 +56,6 @@ function pgsql.backup(){
...
@@ -56,7 +56,6 @@ function pgsql.backup(){
# ----- GO
# ----- GO
# prevent could not change directory to "/root": Permission denied
# prevent could not change directory to "/root": Permission denied
(
cd
/tmp
cd
/tmp
# Detect a readonly or writeable postgres host.
# Detect a readonly or writeable postgres host.
...
@@ -89,8 +88,8 @@ function pgsql.backup(){
...
@@ -89,8 +88,8 @@ function pgsql.backup(){
if
[
$bUseSnapshot4DB
-eq
1
]
;
then
if
[
$bUseSnapshot4DB
-eq
1
]
;
then
echo
-n
" snapshot ... "
echo
-n
" snapshot ... "
su
${
PGUSER
}
-c
"dropdb
${
SNAPSHOTDB
}
"
>
/dev/null 2>&1
su
${
PGUSER
}
-c
"dropdb
${
SNAPSHOTDB
}
"
>
/dev/null 2>&1
if
!
su
${
PGUSER
}
-c
"psql
${
BACKUP_PARAMS
}
-c
\"
CREATE DATABASE
${
SNAPSHOTDB
}
WITH TEMPLATE
${
DATABASE
}
;
\"
"
>
/dev/null
2>&1
;
then
if
!
su
${
PGUSER
}
-c
"psql
${
BACKUP_PARAMS
}
-c
\"
CREATE DATABASE
${
SNAPSHOTDB
}
WITH TEMPLATE
${
DATABASE
}
;
\"
"
>
/dev/null
;
then
echo
-n
"
nope,
using origin ... "
echo
-n
"
Fallback
using origin ... "
bUseSnapshot4DB
=
0
bUseSnapshot4DB
=
0
SNAPSHOTDB
=
"
${
DATABASE
}
"
SNAPSHOTDB
=
"
${
DATABASE
}
"
fi
fi
...
@@ -115,7 +114,7 @@ function pgsql.backup(){
...
@@ -115,7 +114,7 @@ function pgsql.backup(){
fi
fi
done
done
)
cd
-
>
/dev/null
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment