On Thursday 02 December 2010 09:33 PM, Kshitiz wrote:
if ! mount -t ntfs | grep /dev/sdc1 | grep /backup> /dev/null
if mount -t ntfs | grep /dev/sdc1 | grep /backup> /dev/null
Instead of the above 'grep bhai grep' lines simply do an
if grep -q "/mount_point" /etc/mtab
then echo "The device is mounted"
mount /mount_point # Whatever you defined in /etc/fstab for your backup
# Now continue further with the remaining rsync script again using
whatever Binad said in the other mail.
ps -ef | grep '[r]sync'
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.