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
d38e687b
Commit
d38e687b
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
no cd command for restore dump selection
parent
49ab3948
No related branches found
No related tags found
1 merge request
!129
Db Profiles
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
localdump.sh
+11
-8
11 additions, 8 deletions
localdump.sh
with
11 additions
and
8 deletions
localdump.sh
+
11
−
8
View file @
d38e687b
...
@@ -191,17 +191,20 @@
...
@@ -191,17 +191,20 @@
}
}
# ------------------------------------------------------------
# ------------------------------------------------------------
# restore: show databases that can be restored
# restore: show databases
or dumps of a given database
that can be restored
# param string
file filter optional
;
# param string
optional: DB-Name for file filter to select from existing dumps
;
function
listBackupedDBs
(){
function
listBackupedDBs
(){
if
[
-d
"
${
BACKUP_TARGETDIR
}
"
]
;
then
if
[
-d
"
${
BACKUP_TARGETDIR
}
"
]
;
then
cd
"
${
BACKUP_TARGETDIR
}
"
if
[
-z
$1
]
;
then
if
[
-z
$1
]
;
then
find
-type
f |
sed
"s#__[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9].*##g"
|
grep
-v
"
\.
meta"
|
sort
-ud
|
sed
"s#^
\.
/##g"
find
"
${
BACKUP_TARGETDIR
}
"
-mindepth
1
-maxdepth
1
-type
f
-exec
basename
{}
\;
\
|
sed
"s#__[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9][0-9].*##g"
\
|
grep
-v
"
\.
meta"
|
sort
-ud
|
sed
"s#^
\.
/##g"
else
else
ls
-ltr
"
$*
__"
*
|
sed
"s#^
\.
/##g"
|
grep
-v
"
\.
meta"
find
"
${
BACKUP_TARGETDIR
}
"
-mindepth
1
-maxdepth
1
-type
f
-name
"
${
1
}
*"
-exec
basename
{}
\;
\
|
sed
"s#^
\.
/##g"
|
grep
-v
"
\.
meta"
fi
fi
cd
-
>
/dev/null
else
else
color.echo error
"ERROR:
${
BACKUP_TARGETDIR
}
does not exist - here are no backups to restore."
color.echo error
"ERROR:
${
BACKUP_TARGETDIR
}
does not exist - here are no backups to restore."
echo
echo
...
@@ -210,7 +213,7 @@
...
@@ -210,7 +213,7 @@
echo
"
$(
dirname
$0
)
/restore.sh
$BACKUP_BASEDIR
"
echo
"
$(
dirname
$0
)
/restore.sh
$BACKUP_BASEDIR
"
echo
"2) Copy restored dumps into
$BACKUP_TARGETDIR
"
echo
"2) Copy restored dumps into
$BACKUP_TARGETDIR
"
echo
"3) Start database restore again"
echo
"3) Start database restore again"
echo
"
$(
dirname
$0
)
/localdump.sh restore [
servic
e]"
echo
"
$(
dirname
$0
)
/localdump.sh restore [
profil
e]"
echo
echo
exit
1
exit
1
...
@@ -515,6 +518,7 @@
...
@@ -515,6 +518,7 @@
test
-d
"
${
ARCHIVE_BASEDIR
}
/
${
parService
}
"
&&
BACKUP_BASEDIR
=
"
${
ARCHIVE_BASEDIR
}
"
test
-d
"
${
ARCHIVE_BASEDIR
}
/
${
parService
}
"
&&
BACKUP_BASEDIR
=
"
${
ARCHIVE_BASEDIR
}
"
fi
fi
# ----- check if target dir with profile exists
if
[
!
-d
"
${
BACKUP_BASEDIR
}
/
${
parService
}
"
]
;
then
if
[
!
-d
"
${
BACKUP_BASEDIR
}
/
${
parService
}
"
]
;
then
color.echo error
"ERROR: Directory does not exist '
${
BACKUP_BASEDIR
}
/
${
parService
}
'."
color.echo error
"ERROR: Directory does not exist '
${
BACKUP_BASEDIR
}
/
${
parService
}
'."
exit
1
exit
1
...
@@ -570,7 +574,6 @@
...
@@ -570,7 +574,6 @@
BACKUP_PARAMS
=
$(
dbdetect.getParams
)
BACKUP_PARAMS
=
$(
dbdetect.getParams
)
eval
$(
dbdetect.setenv
)
eval
$(
dbdetect.setenv
)
h2
$BACKUP_SCRIPT
$mode
"
${
sDumpfile
}
"
"
${
sTargetDb
}
"
.
$BACKUP_SCRIPT
$mode
"
${
sDumpfile
}
"
"
${
sTargetDb
}
"
.
$BACKUP_SCRIPT
$mode
"
${
sDumpfile
}
"
"
${
sTargetDb
}
"
if
[
$?
-ne
0
-o
$rc
-ne
0
]
;
then
if
[
$?
-ne
0
-o
$rc
-ne
0
]
;
then
...
...
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