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
1eda3641
Commit
1eda3641
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
update __DB__ prefix
parent
8c5db0f1
No related branches found
No related tags found
1 merge request
!49
update __DB__ prefix
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
localdump.sh
+2
-1
2 additions, 1 deletion
localdump.sh
plugins/localdump/mysql.sh
+1
-1
1 addition, 1 deletion
plugins/localdump/mysql.sh
plugins/localdump/pgsql.sh
+1
-1
1 addition, 1 deletion
plugins/localdump/pgsql.sh
plugins/localdump/sqlite.sh
+4
-4
4 additions, 4 deletions
plugins/localdump/sqlite.sh
with
8 additions
and
7 deletions
localdump.sh
+
2
−
1
View file @
1eda3641
...
@@ -98,7 +98,8 @@
...
@@ -98,7 +98,8 @@
else
else
cecho error
"ERROR occured while dumping - no gzip"
cecho error
"ERROR occured while dumping - no gzip"
fi
fi
echo
-n
"__DB__
$SERVICENAME
INFO: backup to "
ls
-l
"
$_outfile
"
*
2>&1
# echo -n "__DB__$SERVICENAME INFO: backup to "
# ls -l "$_outfile"* 2>&1
echo
echo
}
}
...
...
This diff is collapsed.
Click to expand it.
plugins/localdump/mysql.sh
+
1
−
1
View file @
1eda3641
...
@@ -158,7 +158,7 @@ function mysql.backup(){
...
@@ -158,7 +158,7 @@ function mysql.backup(){
for
_dbname
in
$(
mysql.db.list
)
for
_dbname
in
$(
mysql.db.list
)
do
do
echo
-n
"__DB__
${
SERVICENAME
}
$_dbname
backup
"
echo
-n
"__DB__
${
SERVICENAME
}
backup
$_dbname
"
_outfile
=
"
${
BACKUP_TARGETDIR
}
/
$(
get_outfile
${
_dbname
}
)
.sql"
_outfile
=
"
${
BACKUP_TARGETDIR
}
/
$(
get_outfile
${
_dbname
}
)
.sql"
mysql.db.dump
"
$_dbname
"
"
$_outfile
"
mysql.db.dump
"
$_dbname
"
"
$_outfile
"
...
...
This diff is collapsed.
Click to expand it.
plugins/localdump/pgsql.sh
+
1
−
1
View file @
1eda3641
...
@@ -54,7 +54,7 @@ function doPgsqlBackup(){
...
@@ -54,7 +54,7 @@ function doPgsqlBackup(){
sSqlGetDblist
=
"select datname from pg_database where not datistemplate and datallowconn order by datname;"
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 -At -c '
$sSqlGetDblist
' postgres"
2>/dev/null
)
do
do
echo
-n
"__DB__
${
SERVICENAME
}
$_dbname
backup
"
echo
-n
"__DB__
${
SERVICENAME
}
backup
$_dbname
"
OUTFILE
=
"
${
BACKUP_TARGETDIR
}
/
$(
get_outfile
${
DATABASE
}
)
.sql"
OUTFILE
=
"
${
BACKUP_TARGETDIR
}
/
$(
get_outfile
${
DATABASE
}
)
.sql"
su
${
PGUSER
}
-c
"pg_dump -Fp
${
DATABASE
}
>
$OUTFILE
"
su
${
PGUSER
}
-c
"pg_dump -Fp
${
DATABASE
}
>
$OUTFILE
"
fetchrc
fetchrc
...
...
This diff is collapsed.
Click to expand it.
plugins/localdump/sqlite.sh
+
4
−
4
View file @
1eda3641
...
@@ -36,24 +36,24 @@ function doSqliteBackup(){
...
@@ -36,24 +36,24 @@ function doSqliteBackup(){
for
DATABASE_FILE
in
$(
_j_getvar
${
FILEDEFS
}
"sqlite"
)
for
DATABASE_FILE
in
$(
_j_getvar
${
FILEDEFS
}
"sqlite"
)
do
do
echo
-n
"__DB__
${
SERVICENAME
}
$_dbname
backup
"
echo
-n
"__DB__
${
SERVICENAME
}
backup
$DATABASE_FILE
"
if
[
!
-f
"
$DATABASE_FILE
"
]
;
then
if
[
!
-f
"
$DATABASE_FILE
"
]
;
then
color error
color error
echo
"ERROR: given database file does not exist
:
$DATABASE_FILE
"
echo
"ERROR: given database file does not exist"
color reset
color reset
rc
=
$rc
+1
rc
=
$rc
+1
else
else
file
"
$DATABASE_FILE
"
|
cut
-f
2
-d
":"
|
grep
-i
"sqlite"
>
/dev/null
file
"
$DATABASE_FILE
"
|
cut
-f
2
-d
":"
|
grep
-i
"sqlite"
>
/dev/null
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
color error
color error
echo
"ERROR: given database file is not a sqlite database
$DATABASE_FILE
"
echo
"ERROR: given database file is not a sqlite database"
color reset
color reset
rc
=
$rc
+1
rc
=
$rc
+1
else
else
TARGET
=
$(
get_outfile
${
DATABASE_FILE
}
)
TARGET
=
$(
get_outfile
${
DATABASE_FILE
}
)
TARGET
=
${
BACKUP_TARGETDIR
}
/
$(
echo
${
TARGET
}
|
sed
"s#/#_#g"
)
.sql
TARGET
=
${
BACKUP_TARGETDIR
}
/
$(
echo
${
TARGET
}
|
sed
"s#/#_#g"
)
.sql
META
=
${
TARGET
}
.gz.meta
META
=
${
TARGET
}
.gz.meta
echo
target:
$TARGET
echo
-n
" to
$TARGET
"
sqlite3
"
$DATABASE_FILE
"
.dump
>
"
${
TARGET
}
"
sqlite3
"
$DATABASE_FILE
"
.dump
>
"
${
TARGET
}
"
fetchrc
fetchrc
db._compressDumpfile
"
${
TARGET
}
"
db._compressDumpfile
"
${
TARGET
}
"
...
...
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