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

Re: rsync --delete



Joshua J. Kugler wrote:

>On Wednesday 07 June 2006 23:51, Dexter wrote:
>  
>
>>Hi,
>>i use "rsync -rlptgov --delete /mnt/server/dir/ /var/share/server/dir"
>>comand to sinchronize directory on backup server with primary server. I
>>use --delete option, so that files, that do not exist on SRC are deleted
>>also on DST. SRC directory is mounted through NFS on backup server.
>>Acording to manual, rsync should not delete any files if there are any
>>I/O errors, to prevent masive deletion. But masive (whole tree) deletion
>>happened to me, when SRC directory was not mounted and directory
>>"/mnt/server/dir/" was empty.
>>Do you know some way to evoid this to happen?
>>Thanks alot.
>>     Dexter
>>    
>>
>
>You'll need to put a check in your script to make sure your NFS directory is 
>mounted.  Something like this will work:
>
>if mount|grep -q '/mnt/BackupDrive';
>  then
>    echo 'Backup Already Mounted';
>  else
>    echo 'Mounting Backup';
>    if mount /mnt/BackupDrive;
>      then
>        echo 'Backup Mounted';
>    else
>      echo 'BackupDrive failed to mount. Exiting.';
>      exit 1;
>  fi;
>fi;
>
>j
>
>  
>
Thank you wery much for solution. I will try it.
    Dexter



Reply to: