Skip to content

Commit 0e735e9

Browse files
author
Sven Speckmaier
committed
strip directory from find_last_full_backup
1 parent 9d57b16 commit 0e735e9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

entrypoint

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,12 @@ RANCHER_CLI_VERSION="${RANCHER_CLI_VERSION:-v0.4.1}"
2727
TARGET_PREFIX="/target"
2828
DATA_DIRECTORY="/var/lib/mysql"
2929

30+
#
31+
# Find the directory name of the latest full backup
32+
#
3033
find_last_full_backup() {
3134
FILES=( $(ls -d "${TARGET_PREFIX}/"full-????-??-??-??????) )
32-
echo ${FILES[-1]}
35+
basename ${FILES[-1]}
3336
}
3437

3538
download_rancher_compose() {
@@ -204,7 +207,7 @@ backup() {
204207
echo ""
205208
BASE_BACKUP="$(find_last_full_backup)"
206209
BASE_PATH="${TARGET_PREFIX}/${BASE_BACKUP}"
207-
NAME="full-${BASE_BACKUP}-inc-$DATE"
210+
NAME="${BASE_BACKUP}-inc-$DATE"
208211
echo "Base backup: ${BASE_BACKUP}"
209212
echo ""
210213
fi

0 commit comments

Comments
 (0)