Rsync over an NFS mount (Scanned @ Decoma)

Eberhard Moenkeberg emoenke at gwdg.de
Fri Apr 1 21:09:32 GMT 2005


Hi,

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 
> (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.

... easier, and a simple prefix without a nesting level:

NFS_MNT="/mnt/plantx"
mount | grep $NFS_MNT >/dev/null
if [ ! "$?" = 0 ]; then
    echo "source not mounted, nothing done,"
    exit 99
fi

Cheers -e
-- 
Eberhard Moenkeberg (emoenke at gwdg.de, em at kki.org)


More information about the rsync mailing list