From 7b20db3953a54ea1afe877d1f5294d0d26aaef4e Mon Sep 17 00:00:00 2001 From: martinec Date: Sun, 10 Aug 2014 03:08:38 +0200 Subject: [PATCH] fix: ensure a trailing slash in log dir name LOGDIR="/foo/bar" (without a trailing slash) produces /foo/barbackup.lock and/foo/barduplicity-* files, not /foo/bar/backup.lock and /foo/bar/duplicity-* files as expected. This fix ensures a trailing slash in the log dir name. --- duplicity-backup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/duplicity-backup.sh b/duplicity-backup.sh index c5f6e74..192a2e5 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -177,6 +177,9 @@ if [[ -n "$FTP_PASSWORD" ]]; then export FTP_PASSWORD fi +# Ensure a trailing slash always exists in the log directory name +LOGDIR="${LOGDIR%/}/" + LOGFILE="${LOGDIR}${LOG_FILE}" DUPLICITY="$(which duplicity)"