rcopy.sh: fix error checking if backup device is correctly mounted in case if remote backup disk.

This commit is contained in:
Christoph 2020-09-23 03:25:54 +02:00
parent ec9b892b2b
commit 43a253ad4a

View File

@ -183,19 +183,12 @@ elif $remote_disk ; then
sleep 5
fi
if ! df | grep "$backup_mountpoint" > /dev/null 2>&1 ;then
msg="[ Error ]: Mounting remote disk to '$backup_mountpoint' failed. exiting now.."
if $MANUAL ; then
echo -e "\n$msg\n"
else
datum=`date +"%d.%m.%Y"`
echo -e "To:${admin_email}\n${content_type}\nSubject:Backup Errors $company -- $datum\n${msg}\n" | /usr/sbin/sendmail -F "Errors BACKUP $company" -f $from_address $admin_email
fi
exit 1
fi
fi
if $extern_usb_disk || $extern_sata_disk || $intern_disk || $remote_disk ; then
# Check if Backup device is correctly mounted
#
if $extern_usb_disk || $extern_sata_disk || $intern_disk ; then
if ! df | grep "$backup_partition" > /dev/null 2>&1 ;then
msg="[ Error ]: Cannot mount Backup Partion \"$backup_partition\". exiting now.."
@ -218,6 +211,20 @@ if $extern_usb_disk || $extern_sata_disk || $intern_disk || $remote_disk ; then
fi
exit 1
fi
elif $remote_disk ; then
if ! df | grep "$backup_mountpoint" > /dev/null 2>&1 ;then
msg="[ Error ]: Mounting remote disk to '$backup_mountpoint' failed. exiting now.."
if $MANUAL ; then
echo -e "\n$msg\n"
else
datum=`date +"%d.%m.%Y"`
echo -e "To:${admin_email}\n${content_type}\nSubject:Backup Errors $company -- $datum\n${msg}\n" | /usr/sbin/sendmail -F "Errors BACKUP $company" -f $from_address $admin_email
fi
exit 1
fi
fi