Hi,
On Fri, 1 Apr 2005, John Jablonski wrote:
[EMAIL PROTECTED] wrote:
Um.....why wouldn't you have the NFS share automatically mount at boot time (fstab)?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 ???
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 ([EMAIL PROTECTED], [EMAIL PROTECTED]) -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html