DocForbin
September 21st, 2008, 12:32 AM
Looking for tips on preventing rsync from running if the source or destination drives are not mounted.
I use rsync -avh --delete --progress /mnt/media /mnt/backup to sync a backup usb drive from another usb drive. If I run it and the destination drive isn't mounted, it will sync the files to the local filesystem. If the source drive isn't mounted, the destination drive is purged.
Would a shell script that checks if the drives are mounted before running rsync be straightforward?
I use rsync -avh --delete --progress /mnt/media /mnt/backup to sync a backup usb drive from another usb drive. If I run it and the destination drive isn't mounted, it will sync the files to the local filesystem. If the source drive isn't mounted, the destination drive is purged.
Would a shell script that checks if the drives are mounted before running rsync be straightforward?