From a83a80300bbc667242d4f89959700a42b5edef4c Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Wed, 29 Jul 2015 10:28:44 +0200 Subject: [PATCH] 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 :-/ --- bin/backup-script | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) ..." \ -- 2.39.2