Skip to content

Commit 508bceb

Browse files
committed
rsyncbackup: do not unmount any drives if backup failed because pending snashot exists
Signed-off-by: Simon L. <[email protected]>
1 parent 42eb263 commit 508bceb

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

not-supported/rsyncbackup.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,16 @@ show_drive_usage() {
4747
}
4848
send_error_mail() {
4949
if [ -d "$BACKUP_TARGET_DIRECTORY" ]
50-
then
51-
inform_user "$ICyan" "Unmounting the off-shore backup drive..."
52-
umount "$BACKUP_MOUNTPOINT"
53-
fi
50+
if [ -z "$DO_NOT_UMOUNT_BACKUP_DRIVES" ]
51+
then
52+
inform_user "$ICyan" "Unmounting the offshore backup drive..."
53+
umount "$BACKUP_MOUNTPOINT"
54+
fi
5455
if [ -d "$BACKUP_SOURCE_DIRECTORY" ]
5556
then
56-
if [ -z "$DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE" ]
57+
if [ -z "$DO_NOT_UMOUNT_BACKUP_DRIVES" ]
5758
then
58-
inform_user "$ICyan" "Unmounting the backup drive..."
59+
inform_user "$ICyan" "Unmounting the daily backup drive..."
5960
umount "$BACKUP_SOURCE_MOUNTPOINT"
6061
fi
6162
fi
@@ -124,7 +125,7 @@ fi
124125
# Check if pending snapshot is existing and cancel the backup in this case.
125126
if does_snapshot_exist "NcVM-snapshot-pending"
126127
then
127-
DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE=1
128+
DO_NOT_UMOUNT_BACKUP_DRIVES=1
128129
msg_box "The snapshot pending does exist. Can currently not proceed.
129130
Please try again later.\n
130131
If you are sure that no update or backup is currently running, you can fix this by rebooting your server."
@@ -193,7 +194,7 @@ fi
193194
# Check if pending snapshot is existing and cancel the backup in this case.
194195
if does_snapshot_exist "NcVM-snapshot-pending"
195196
then
196-
DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE=1
197+
DO_NOT_UMOUNT_BACKUP_DRIVES=1
197198
msg_box "The snapshot pending does exist. Can currently not proceed.
198199
Please try again later.\n
199200
If you are sure that no update or backup is currently running, you can fix this by rebooting your server."

0 commit comments

Comments
 (0)