detect interruption, skip rotation
This commit is contained in:
parent
8aa355421d
commit
b3a7fa44c9
@ -129,6 +129,10 @@ rotateBackup() {
|
|||||||
then
|
then
|
||||||
echo "Previous backup failed, skipping rotation."
|
echo "Previous backup failed, skipping rotation."
|
||||||
rm "$SNAPSHOT_RW/$NAME/daily.0"
|
rm "$SNAPSHOT_RW/$NAME/daily.0"
|
||||||
|
elif [ -f "$SNAPSHOT_RW/$NAME/daily.0/unfinished.remote-backup" ]
|
||||||
|
then
|
||||||
|
echo "Previous backup interrupted, skipping rotation."
|
||||||
|
rm "$SNAPSHOT_RW/$NAME/daily.0/unfinished.remote-backup"
|
||||||
else
|
else
|
||||||
# step 1: delete the oldest snapshot, if it exists:
|
# step 1: delete the oldest snapshot, if it exists:
|
||||||
if [ -d "$SNAPSHOT_RW/$NAME/daily.${MAX_ROTATE}" ]
|
if [ -d "$SNAPSHOT_RW/$NAME/daily.${MAX_ROTATE}" ]
|
||||||
@ -175,7 +179,11 @@ runBackup() {
|
|||||||
$RSYNC \
|
$RSYNC \
|
||||||
$RSYNC_OPTS \
|
$RSYNC_OPTS \
|
||||||
"${REMOTE_LOCATION}" \
|
"${REMOTE_LOCATION}" \
|
||||||
"$SNAPSHOT_RW/$NAME/$1"
|
"$SNAPSHOT_RW/$NAME/$1" \
|
||||||
|
|| if [ -d "$SNAPSHOT_RW/$NAME/$1" ]
|
||||||
|
then
|
||||||
|
touch "$SNAPSHOT_RW/$NAME/$1/unfinished.remote-backup"
|
||||||
|
fi
|
||||||
|
|
||||||
# step 5: update the mtime of daily.0 to reflect the snapshot time
|
# step 5: update the mtime of daily.0 to reflect the snapshot time
|
||||||
$TOUCH "$SNAPSHOT_RW/$NAME/$1"
|
$TOUCH "$SNAPSHOT_RW/$NAME/$1"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user