Skip to content

Commit 1e328fc

Browse files
authored
rsyncbackup: do not unmount any drives if backup failed because pending snashot exists (#2720)
Signed-off-by: Simon L. <szaimen@e.mail.de>
1 parent 42eb263 commit 1e328fc

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

not-supported/rsyncbackup.sh

+9-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ debug_mode
1919
root_check
2020

2121
# Variables
22-
LVM_MOUNT="/system"
2322
START_TIME=$(date +%s)
2423
CURRENT_DATE=$(date --date @"$START_TIME" +"%Y%m%d_%H%M%S")
2524
CURRENT_DATE_READABLE=$(date --date @"$START_TIME" +"%d.%m.%Y - %H:%M:%S")
@@ -48,14 +47,17 @@ show_drive_usage() {
4847
send_error_mail() {
4948
if [ -d "$BACKUP_TARGET_DIRECTORY" ]
5049
then
51-
inform_user "$ICyan" "Unmounting the off-shore backup drive..."
52-
umount "$BACKUP_MOUNTPOINT"
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
5355
fi
5456
if [ -d "$BACKUP_SOURCE_DIRECTORY" ]
5557
then
56-
if [ -z "$DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE" ]
58+
if [ -z "$DO_NOT_UMOUNT_BACKUP_DRIVES" ]
5759
then
58-
inform_user "$ICyan" "Unmounting the backup drive..."
60+
inform_user "$ICyan" "Unmounting the daily backup drive..."
5961
umount "$BACKUP_SOURCE_MOUNTPOINT"
6062
fi
6163
fi
@@ -124,7 +126,7 @@ fi
124126
# Check if pending snapshot is existing and cancel the backup in this case.
125127
if does_snapshot_exist "NcVM-snapshot-pending"
126128
then
127-
DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE=1
129+
DO_NOT_UMOUNT_BACKUP_DRIVES=1
128130
msg_box "The snapshot pending does exist. Can currently not proceed.
129131
Please try again later.\n
130132
If you are sure that no update or backup is currently running, you can fix this by rebooting your server."
@@ -193,7 +195,7 @@ fi
193195
# Check if pending snapshot is existing and cancel the backup in this case.
194196
if does_snapshot_exist "NcVM-snapshot-pending"
195197
then
196-
DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE=1
198+
DO_NOT_UMOUNT_BACKUP_DRIVES=1
197199
msg_box "The snapshot pending does exist. Can currently not proceed.
198200
Please try again later.\n
199201
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)