On 11/29/2013 01:03 AM, Rajagopal Swaminathan wrote:
Greetings,
I have two distinct queries
- How to detect removal of external usb hard disk within a script and
stop backup?
You should know what the path to the external storage is when you have it mounted. Just check the path to see if the directory exists:
if ( -d "Path to a directory on the mounted volume" ) { Run Your Backup; } else { Take Some Other Action; }
This is perl script, but the same concept will work with shell script with slightly different syntax.