On Thursday 02 December 2010 09:33 PM, Kshitiz wrote:
>
> -------------
>
> if ! mount -t ntfs | grep /dev/sdc1 | grep /backup>  /dev/null
>      then
>          mount /dev/sdc1
> fi
> if mount -t ntfs | grep /dev/sdc1 | grep /backup>  /dev/null
>       then
>    

Instead of the above 'grep bhai grep' lines simply do an

if grep -q "/mount_point" /etc/mtab

then echo "The device is mounted"

else

mount /mount_point  # Whatever you defined in /etc/fstab for your backup 
device.

# Now continue further with the remaining rsync script again using 
whatever Binad said in the other mail.

if

ps -ef | grep '[r]sync'

then

# whatever.



>   if [ $? -eq 1 ]; then #rsync isn't running - let's launch it now
>              rsync -avz -e --delete /home/ /backup
>    

rsync  --delete /home /backup?

If someone has deleted a file from the source dir, you are making sure 
that the available backup is also deleted?  Not a very pleasant situation.

Assuming that your script is for usb devices and runs automatically, is 
there any protection to ensure that someone does not plug in a personal 
disk and walk away with the data so neatly backed up?


-- 

As a proper list etiquette...
Please trim your replies.
Post your replies below the relevant original text, leaving a line space.
Do not re-use old messages to write new ones.

Regards,

Rony.

-- 
http://mm.glug-bom.org/mailman/listinfo/linuxers

Reply via email to