fix rotation

This commit is contained in:
Vincent Riquer 2012-02-08 10:31:25 +01:00
parent 17b8b1d51d
commit c4bcbc290f
2 changed files with 10 additions and 4 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
remote-backup (1.2.2) stable; urgency=low
* fix rotation
-- Vincent Riquer <v.riquer@b2f-concept.com> Fri, 03 Feb 2012 10:45:45 +0100
remote-backup (1.2.1) stable; urgency=low remote-backup (1.2.1) stable; urgency=low
* add TIMEOUT parameter (defaults to 1800 seconds). * add TIMEOUT parameter (defaults to 1800 seconds).

View File

@ -141,12 +141,12 @@ rotateBackup() {
fi fi
# step 2: shift the snapshots(s) back by one, if they exist # step 2: shift the snapshots(s) back by one, if they exist
for backup_number in {$((${MAX_ROTATE}-1))..0} for (( backup_num=$MAX_ROTATE ; backup_num >= 0 ; backup_num-- ))
do do
if [ -d "$SNAPSHOT_RW/$NAME/daily.${backup_number}" ] if [ -d "$SNAPSHOT_RW/$NAME/daily.${backup_num}" ]
then then
$MV -f "$SNAPSHOT_RW/$NAME/daily.${backup_number}" \ $MV -f "$SNAPSHOT_RW/$NAME/daily.${backup_num}" \
"$SNAPSHOT_RW/$NAME/daily.$((${backup_number}+1))" "$SNAPSHOT_RW/$NAME/daily.$(( backup_num + 1 ))"
fi fi
done done
fi fi