Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsyncbackup: do not unmount any drives if backup failed because pendi… #2720

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions not-supported/rsyncbackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ debug_mode
root_check

# Variables
LVM_MOUNT="/system"
START_TIME=$(date +%s)
CURRENT_DATE=$(date --date @"$START_TIME" +"%Y%m%d_%H%M%S")
CURRENT_DATE_READABLE=$(date --date @"$START_TIME" +"%d.%m.%Y - %H:%M:%S")
Expand Down Expand Up @@ -48,14 +47,17 @@ show_drive_usage() {
send_error_mail() {
if [ -d "$BACKUP_TARGET_DIRECTORY" ]
then
inform_user "$ICyan" "Unmounting the off-shore backup drive..."
umount "$BACKUP_MOUNTPOINT"
if [ -z "$DO_NOT_UMOUNT_BACKUP_DRIVES" ]
then
inform_user "$ICyan" "Unmounting the offshore backup drive..."
umount "$BACKUP_MOUNTPOINT"
fi
fi
if [ -d "$BACKUP_SOURCE_DIRECTORY" ]
then
if [ -z "$DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE" ]
if [ -z "$DO_NOT_UMOUNT_BACKUP_DRIVES" ]
then
inform_user "$ICyan" "Unmounting the backup drive..."
inform_user "$ICyan" "Unmounting the daily backup drive..."
umount "$BACKUP_SOURCE_MOUNTPOINT"
fi
fi
Expand Down Expand Up @@ -124,7 +126,7 @@ fi
# Check if pending snapshot is existing and cancel the backup in this case.
if does_snapshot_exist "NcVM-snapshot-pending"
then
DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE=1
DO_NOT_UMOUNT_BACKUP_DRIVES=1
msg_box "The snapshot pending does exist. Can currently not proceed.
Please try again later.\n
If you are sure that no update or backup is currently running, you can fix this by rebooting your server."
Expand Down Expand Up @@ -193,7 +195,7 @@ fi
# Check if pending snapshot is existing and cancel the backup in this case.
if does_snapshot_exist "NcVM-snapshot-pending"
then
DO_NOT_UMOUNT_DAILY_BACKUP_DRIVE=1
DO_NOT_UMOUNT_BACKUP_DRIVES=1
msg_box "The snapshot pending does exist. Can currently not proceed.
Please try again later.\n
If you are sure that no update or backup is currently running, you can fix this by rebooting your server."
Expand Down