Skip to content

Commit ba9b10f

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 ba9b10f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

not-supported/rsyncbackup.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,17 @@ show_drive_usage() {
4848
send_error_mail() {
4949
if [ -d "$BACKUP_TARGET_DIRECTORY" ]
5050
then
51-
inform_user "$ICyan" "Unmounting the off-shore backup drive..."
52-
umount "$BACKUP_MOUNTPOINT"
51+
if [ -z "$DO_NOT_UMOUNT_BACKUP_DRIVES" ]
52+
then
53+
inform_user "$ICyan" "Unmounting the offshore backup drive..."
54+
umount "$BACKUP_MOUNTPOINT"
55+
fi
5356
fi
5457
if [ -d "$BACKUP_SOURCE_DIRECTORY" ]
5558
then
56-
if [ -z "$DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE" ]
59+
if [ -z "$DO_NOT_UMOUNT_BACKUP_DRIVES" ]
5760
then
58-
inform_user "$ICyan" "Unmounting the backup drive..."
61+
inform_user "$ICyan" "Unmounting the daily backup drive..."
5962
umount "$BACKUP_SOURCE_MOUNTPOINT"
6063
fi
6164
fi
@@ -124,7 +127,7 @@ fi
124127
# Check if pending snapshot is existing and cancel the backup in this case.
125128
if does_snapshot_exist "NcVM-snapshot-pending"
126129
then
127-
DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE=1
130+
DO_NOT_UMOUNT_BACKUP_DRIVES=1
128131
msg_box "The snapshot pending does exist. Can currently not proceed.
129132
Please try again later.\n
130133
If you are sure that no update or backup is currently running, you can fix this by rebooting your server."
@@ -193,7 +196,7 @@ fi
193196
# Check if pending snapshot is existing and cancel the backup in this case.
194197
if does_snapshot_exist "NcVM-snapshot-pending"
195198
then
196-
DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE=1
199+
DO_NOT_UMOUNT_BACKUP_DRIVES=1
197200
msg_box "The snapshot pending does exist. Can currently not proceed.
198201
Please try again later.\n
199202
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)