Re: Two queries: samba and usb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 11/29/2013 01:03 AM, Rajagopal Swaminathan wrote:
> Greetings,
> 
> I have two distinct queries
> 
> 1. 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.


-- 
    _
   °v°
  /(_)\
   ^ ^  Mark LaPierre
Registered Linux user No #267004
https://linuxcounter.net/
****
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos





[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux