7b20db3953a54ea1afe877d1f5294d0d26aaef4e

Author
martinec <martinec@users.noreply.github.com>
Committer
martinec <martinec@users.noreply.github.com>
Date

Message

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.

Diff

 1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
 2index c5f6e749e599966cc5a4958db027029341435f32..192a2e5c182e48097badc36844622ea6a42bbcf9 100755
 3--- a/duplicity-backup.sh
 4+++ b/duplicity-backup.sh
 5@@ -177,6 +177,9 @@ if [[ -n "$FTP_PASSWORD" ]]; then
 6   export FTP_PASSWORD
 7 fi
 8 
 9+# Ensure a trailing slash always exists in the log directory name
10+LOGDIR="${LOGDIR%/}/"
11+
12 LOGFILE="${LOGDIR}${LOG_FILE}"
13 DUPLICITY="$(which duplicity)"
14