0

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

0

1 Answer 1

0

sudo mount /dev/sXX && rsync whatever

I have tested and i receive email errors if mount fails. Therefore this uses crontab/rsync and notifies me of failed mounts via email.

Not really a script, but hey, why do extra work, K.I.S.S. !

1
  • PS: one & between commands means second command will be passed regardless of first, two && stringing together commands means, second will not be passed unless first reports back positive, true, etc. (Does not always work as intended depending on how command reports back its results, but I have never had an issue so far) Jun 29, 2015 at 4:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .