Lester_Linnell@decoma.com
2005-Apr-01 20:16 UTC
Rsync over an NFS mount (Scanned @ Decoma)
If I perform an local rsync with the 'delete' option over an NFS mount, and the mount point has been unmounted, the rsync will delete what was once on the local box.. For example Machine 1(192.168.0.1) is a live production server with a database within the /DB directory Machine 2 (192.168.0.2) is an idling server, capturing all changes of Machine 1's database. The rsync is done over an NFS mount onto machine 1, rather than via rsync client/server>From Machine 2 :mkdir /mnt/plantx mount 192.168.0.1:/DB/plantx /mnt/plantx rsync -av --delete 127.0.0.1:/mnt/plantx/ /DB/plantx -e ssh Now , If I reboot machine 2, and forget to do the NFS mount, (actually the above rsync is in a crontab entry to happen automatically), then the /DB/plantx will be empty due to the 'delete' option of the rsync statement. I would assume this is a bug ??? (Embedded image moved to file: pic01842.jpg) CONFIDENTIALITY NOTE: This message may contain information that is privileged or confidential. As such, if you are not the intended recipient, please delete this message without retaining, distributing or copying all or any portion of its contents and notify us immediately of your receipt by return message to the sender or by calling our office at (905) 669-2888. Thank you in advance for your assistance. -------------- next part -------------- A non-text attachment was scrubbed... Name: pic01842.jpg Type: image/jpeg Size: 7892 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20050401/f0ff7591/pic01842.jpg
Hi, On Fri, 1 Apr 2005 Lester_Linnell@decoma.com wrote:> If I perform an local rsync with the 'delete' option over an NFS mount, and > the mount point has been unmounted, the rsync will delete what was once on > the local box..This is correct behaviour, if the source directory is empty. Ckeck if mounted before invoking rsync. Cheers -e -- Eberhard Moenkeberg (emoenke@gwdg.de, em@kki.org)
Lester_Linnell@decoma.com wrote:>Now , If I reboot machine 2, and forget to do the NFS mount, (actually the >above rsync is in a crontab entry to happen automatically), then the >/DB/plantx will be empty due to the 'delete' option of the rsync statement. >I would assume this is a bug ??? > > >Um.....why wouldn't you have the NFS share automatically mount at boot time (fstab)? And/or, like Mr. Moenkeberg suggested: NFS_MNT="/mnt/plantx" MOUNT_CHK=`/bin/mount -l | /bin/grep $NFS_MNT | /usr/bin/wc -l` if [ "$MOUNT_CHK" = 1 ] rsync... exit 0 else echo "D'oh! You didn't mount the NFS share again!" > /var/log/rsync.log exit 1 fi Works for bash on linux anyways. Tis what I do for local backups to a USB drive. Gotta make sure it's actually plugged in or else your harddrive fills up REALLY quick. -john
Seemingly Similar Threads
- [LLVMdev] Getting address of label in jitted code[MESSAGE NOT SCANNED]
- [LLVMdev] Getting address of label in jitted code[MESSAGE NOT SCANNED]
- [LLVMdev] Why LLVM should NOT have garbage collection intrinsics[MESSAGE NOT SCANNED]
- [LLVMdev] x86 unwind support[MESSAGE NOT SCANNED]
- [LLVMdev] x86 unwind support[MESSAGE NOT SCANNED]