From: Alexander Barton Date: Wed, 29 Jul 2015 08:28:44 +0000 (+0200) Subject: Use correct counter when checking which generations to delete X-Git-Url: https://arthur.barton.de/gitweb/?p=backup-script.git;a=commitdiff_plain;h=a83a80300bbc667242d4f89959700a42b5edef4c Use correct counter when checking which generations to delete In a18f7fb9 we fixed the counter, but up to now didn't use the correct counter at all :-/ --- diff --git a/bin/backup-script b/bin/backup-script index 79b171d..478e505 100755 --- a/bin/backup-script +++ b/bin/backup-script @@ -452,8 +452,8 @@ for f in $sys; do ln -s "$sys_target" "$sys_root/latest" fi # Clean up old generations - to_delete=$(ls -1t "$sys_root" 2>/dev/null | tail -n+$generations | sort) declare -i gen_count=$generations+2 + to_delete=$(ls -1t "$sys_root" 2>/dev/null | tail -n+$gen_count | sort) if [ -n "$to_delete" -a $ok -eq 1 ]; then [ "$DRYRUN" -eq 0 ] \ && echo "Deleting old backup generations (keep $generations) ..." \