I setup a Samba server for a small family business. The owner would like to have automatic backups to 2 usb drives such that she can take one home each night while cron runs a backup on the other, then swap them when she gets back the next morning.
My script to do automatic backups was simply making sure /dev/sdb1 was mounted to /mnt/backups and then doing a recursive copy. However sometimes the drives get mapped to other letters such as sdc1 or sdd1, so the copy never happens.
What would be the appropriate way to script a backup procedure for this setup since I can't guarantee usb drives are always going to be mapped to the same letters? Would using UUID's on the devices help? What commands can I use to check if a device is mounted correctly, and if not, attempt to remount the other drive before attempting a backup?
Any help would be greatly appreciated!
Bookmarks