I have a toshiba 3tb ExtHD and it consistently gets unmounted if I say shutdown computer then turn it on to a live cd then reboot back into OS. Its a simple fix, all I do is unplug and re-plug the USB cord and mount and its back. Its annoying, but im not going to go get another drive due to this inconvenience.
I will take it as a learning experience opportunity. I use Rsync to mirror my internal 3tb drive with my external one, but sometimes, the Toshiba is unmounted and i get server errors because the internal drive that the mount point is on gets to 100%.
Specific Question:
I would like to use crontab like I do now, to rsync my internal HD to my external HD, but check that its mounted first and if it is not, then fail and send me mail or output to log file.
Current SetUp
- Ubuntu Server 14.04 LTS 64 bit.
- The toshiba drive is
/dev/sdd1
- The internal 3tb drive is
/dev/sdc1
the mountpoints are as follows:
/media/cloud/donut/files/disks/primary (internal3tb)
/media/cloud/donut/files/exthd/toshiba
Not sure if it matters, but the internal is ext4 and the external is ntfs.
I think I included all the information needed to create script, I´m guessing I would create script then call it in crontab
? or just place entire script in crontab
?
Any help is much appreciated, if you need more information let me know.
PS: programming is not my strong suite, but I´m not completely ignorant I have dabbled in Java and PHP. (I get If then statements lol :P)
Thanks