Some syncs and a final check that the drive unmounted
This commit is contained in:
parent
5cff8289ae
commit
319aab9f00
|
@ -1566,12 +1566,16 @@ function create_backup_script {
|
|||
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo "if [ ! -d $USB_MOUNT ]; then" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo ' sync' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo " mkdir $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo -n ' mount $USB_DRIVE ' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo "$USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo ' sync' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo " umount $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo ' sync' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo -n ' mount $USB_DRIVE ' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo "$USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo ' sync' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo ' if [ ! "$?" = "0" ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo " echo 'There was a problem mounting the USB drive to $USB_MOUNT'" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo " rm -rf $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
|
@ -2122,6 +2126,11 @@ function create_backup_script {
|
|||
|
||||
echo 'sync' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo "umount $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo 'if [ ! "$?" = "0" ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo ' echo "Unable to unmount the drive. This means that the backup did not work"' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo " rm -rf $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo ' exit 46994' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo "rm -rf $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo 'echo "Backup to USB drive is complete. You can now unplug it."' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
echo 'exit 0' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||
|
|
Loading…
Reference in New Issue