Results 1 to 4 of 4
Hi,
Can anyone teach me how to check whether NFS is mounted in a script?
I am trying do a backup using NFS to another computer. In the script, I ...
- 09-18-2004 #1Just Joined!
- Join Date
- Sep 2004
- Posts
- 9
HELP: Script to test NFS mount
Hi,
Can anyone teach me how to check whether NFS is mounted in a script?
I am trying do a backup using NFS to another computer. In the script, I will be using rsync. However I would like to make sure that the NFS is mounted successful before proceeding to rsync.
Any help will be appreciated.
Cheers,
Fruits
- 09-18-2004 #2
***Moved to Linux Networking***
"Time is an illusion. Lunchtime, doubly so."
~Douglas Adams, The Hitchhiker's Guide to the Galaxy
- 09-23-2004 #3Just Joined!
- Join Date
- Jun 2004
- Location
- London, UK
- Posts
- 53
Hi,
Either do this by checking for a known file on the NFS-mount (perhaps a mount-check flag file you have created).
Another option is to check the /proc/mount 'file' for the desired mount.Code:if [ -f /nfs/mount1/.tagfile ]; then echo "Yep, mounted!" else echo "No, not mounted!" fi
Good luck with your backup script, rsync rocksCode:if grep "^server:/nfs/mount1" /proc/mounts >/dev/null; then echo "YEAH!" else echo "NO" fi
- 09-23-2004 #4Just Joined!
- Join Date
- Sep 2004
- Posts
- 9
Thanks !!!
Use the first method. work fine for me, added a mail to my email address if inform me of backup server error.
Appreciate it. you make my day



