diff --git a/local_backup.sh b/local_backup.sh index 0fa4356..70b85bf 100755 --- a/local_backup.sh +++ b/local_backup.sh @@ -13,17 +13,10 @@ echo "" # echo "OS we're running on is $OS" source ~/git/shell-scripts/check_os.sh -if [[ "$OS" =~ .*Solus.* ]] - then - echo "Setting mount point for Solus" - mount_point='/run/media/tracey/LinuxBack' -elif [[ "$OS" = "Ubuntu" ]] - then - echo "Setting mount point for Ubuntu" - mount_point='/media/tracey/LinuxBack' -else - echo "Unknown OS!" -fi +# Get the mount point by uuid +UUID=ff0b3c83-853d-452f-abb6-48069e337446 +mount_point=`findmnt -rn -S UUID=$UUID -o TARGET` + echo "Mount point is $mount_point" # Check whether target volume is mounted, and mount it if not. @@ -39,7 +32,7 @@ else echo "${mount_point} is already mounted."; fi # Target volume **must** be mounted by this point. If not, die screaming. if ! mountpoint -q ${mount_point}/; then - echo "Mounting failed! Cannot run backup without backup volume!" + echo "Mounting failed! Cannot run backup without mounted backup volume!" exit 1 fi