Hello friends
I use rsync to copy my incremental data to an external harddisk every 5 minutes using cron. However, if the external harddisk, connected to the USB port is disconnected, the root partition fills up. I need your help to create a proper script that does the following:
Before running the rsync copying script, I want to
a) Add some statement that would check if the external harddisk is attached and mounted.
b) If not, it should be mounted before the copying script is run to copy only to this external disk.
c) If it is not mounted, mount should be attempted, and if it does not mount, rsync copying command should not be executed.
Is there any better way to do this?
Under no circumstances, I want the rsync script to execute if the USB connection is not active.
Regards and thank you all in advance
Kshitiz