From ac9917c5a9c0df982ab2c1935991634259924d38 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 14 Apr 2021 09:37:31 +0200 Subject: last-backups: cleanup --- last-backups.in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/last-backups.in b/last-backups.in index ac7f01a..4a4c7e3 100755 --- a/last-backups.in +++ b/last-backups.in @@ -57,7 +57,18 @@ do ) [ "${lbu}" == "" ] && lbu="1970_01_01" delta=$[$(date +%s) - $(date -d $(echo ${lbu} | sed "s/_//g") +%s)] - namen[${#namen[@]}]="$(basename $(echo ${dest} | sed "s#/\(${recognSubdirRegex}\)\$#_\1#" | sed "s#/rsync\$##; s#/duplicity\$##"))" + namen[${#namen[@]}]=$( + basename $( + echo "${dest}" \ + | sed ' + s#/\('"${recognSubdirRegex}"'\)$#_\1# + ' \ + | sed ' + s#/rsync$## + s#/duplicity$## + ' + ) + ) if [ -f "/tmp/${backupID}.pid" ] && pgrep '(^|/|\s)backup\S*$' | grep -qxF "$(cat "/tmp/${backupID}.pid")"; then laeuft='_laeuft' else -- cgit v1.2.3-70-g09d2