Rsync over an NFS mount (Scanned @ Decoma)
emoenke at gwdg.de
Fri Apr 1 21:09:32 GMT 2005
On Fri, 1 Apr 2005, John Jablonski wrote:
> Lester_Linnell at 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
> And/or, like Mr. Moenkeberg suggested:
> MOUNT_CHK=`/bin/mount -l | /bin/grep $NFS_MNT | /usr/bin/wc -l`
> if [ "$MOUNT_CHK" = 1 ]
> exit 0
> echo "D'oh! You didn't mount the NFS share again!" > /var/log/rsync.log
> exit 1
> 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.
... easier, and a simple prefix without a nesting level:
mount | grep $NFS_MNT >/dev/null
if [ ! "$?" = 0 ]; then
echo "source not mounted, nothing done,"
Eberhard Moenkeberg (emoenke at gwdg.de, em at kki.org)
More information about the rsync