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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
f96049ca
Commit
f96049ca
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update pgsql + couchdb scripts
parent
c232f061
No related branches found
No related tags found
1 merge request
!129
Db Profiles
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/localdump/couchdb2.sh
+1
-1
1 addition, 1 deletion
plugins/localdump/couchdb2.sh
plugins/localdump/pgsql.sh
+4
-4
4 additions, 4 deletions
plugins/localdump/pgsql.sh
with
5 additions
and
5 deletions
plugins/localdump/couchdb2.sh
+
1
−
1
View file @
f96049ca
...
...
@@ -514,7 +514,7 @@ rc=$rc+$?
if
[
$rc
-eq
0
]
;
then
echo
OK: couchdb2 config was found on this system ... checking requirements
for
backup ...
#
echo OK: couchdb2 config was found on this system ... checking requirements for backup ...
j_requireBinary
"curl"
1
j_requireBinary
"couchbackup"
1
...
...
This diff is collapsed.
Click to expand it.
plugins/localdump/pgsql.sh
+
4
−
4
View file @
f96049ca
...
...
@@ -55,11 +55,11 @@ function doPgsqlBackup(){
# prevent could not change directory to "/root": Permission denied
cd
/tmp
sSqlGetDblist
=
"select datname from pg_database where not datistemplate and datallowconn order by datname;"
for
DATABASE
in
$(
su
${
PGUSER
}
-c
"psql -At -c '
$sSqlGetDblist
' postgres"
2>/dev/null
)
for
DATABASE
in
$(
su
${
PGUSER
}
-c
"psql
${
BACKUP_PARAMS
}
-At -c '
$sSqlGetDblist
' postgres"
2>/dev/null
)
do
echo
-n
"__DB__
${
SERVICENAME
}
backup
$DATABASE
... "
OUTFILE
=
"
${
BACKUP_TARGETDIR
}
/
$(
get_outfile
${
DATABASE
}
)
.sql"
su
${
PGUSER
}
-c
"pg_dump -Fp
${
DATABASE
}
>
$OUTFILE
"
su
${
PGUSER
}
-c
"pg_dump
${
BACKUP_PARAMS
}
-Fp
${
DATABASE
}
>
$OUTFILE
"
fetchrc
>
/dev/null
db._compressDumpfile
"
$OUTFILE
"
...
...
@@ -95,7 +95,7 @@ function restoreByFile(){
h2
"ensure that database exists ..."
color cmd
su
${
PGUSER
}
-c
"psql -c
\"
CREATE DATABASE
${
sMyDb
}
;
\"
"
su
${
PGUSER
}
-c
"psql
${
BACKUP_PARAMS
}
-c
\"
CREATE DATABASE
${
sMyDb
}
;
\"
"
fetchrc
color reset
...
...
@@ -103,7 +103,7 @@ function restoreByFile(){
ls
-l
"
${
sMyfile
}
"
echo
"import to database [
${
sMyDb
}
]"
color cmd
zcat
"
${
sMyfile
}
"
| su
${
PGUSER
}
-c
"psql -d
${
sMyDb
}
"
zcat
"
${
sMyfile
}
"
| su
${
PGUSER
}
-c
"psql
${
BACKUP_PARAMS
}
-d
${
sMyDb
}
"
fetchrc
color reset
...
...
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