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
27706b8b
Commit
27706b8b
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
fix: get filename from select with single value
parent
c9c63d1f
No related branches found
No related tags found
1 merge request
!132
fix: get filename from select with single value
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
localdump.sh
+3
-2
3 additions, 2 deletions
localdump.sh
with
3 additions
and
2 deletions
localdump.sh
+
3
−
2
View file @
27706b8b
...
@@ -569,13 +569,14 @@ EOH
...
@@ -569,13 +569,14 @@ EOH
# if there is a single dump in backup folder:
# if there is a single dump in backup folder:
# '-rw-r--r-- 1 root root 481 Mar 13 12:27 ahcrawler__20240313-1227.sql.gz'
# '-rw-r--r-- 1 root root 481 Mar 13 12:27 ahcrawler__20240313-1227.sql.gz'
# --> take the last part behind the last space to get a filename
# --> take the last part behind the last space to get a filename
grep
"^-[rwxsSt
\-
]* "
<<<
"
$LASTINPUT
"
&&
dbfile
=
"
$(
rev
<<<
\'
"
$LASTINPUT
"
\'
|
cut
-d
' '
-f
1 | rev
)
"
grep
"[rwxsSt
\-
]{10,} "
<<<
"
$LASTINPUT
"
\
&&
dbfile
=
"
$(
rev
<<<
\'
"
$LASTINPUT
"
\'
|
cut
-d
' '
-f
1 | rev
)
"
echo
echo
sTargetDb
=
$(
guessDB
${
dbfile
}
)
sTargetDb
=
$(
guessDB
${
dbfile
}
)
color.print input
"New database name [
$sTargetDb
] >"
color.print input
"New database name [
$sTargetDb
] >"
read
-r
sTargetDb
read
-r
sTargetDb
if
[
-z
$sTargetDb
]
;
then
if
[
-z
"
$sTargetDb
"
]
;
then
sTargetDb
=
$(
guessDB
${
dbfile
}
)
sTargetDb
=
$(
guessDB
${
dbfile
}
)
fi
fi
echo
echo
...
...
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