LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2012, 01:25 AM   #1
Vi_rod
Member
 
Registered: Dec 2011
Posts: 42

Rep: Reputation: Disabled
Mount script not working


Hi,
I ve written a simple script for checking if a NFS server is mounted or not. But even if I manually switch it off, it is still not detecting that the server is not mounted.
the script -
Code:
if grep -i "192.168.2.7" /proc/mounts > /dev/null 2>&1 ; then
echo "It is mounted on $HOSTNAME ,as on $DATE" >> test_pingtwo.log
else
echo "DATAMAN is not mounted on $HOSTNAME, as on $DATE, Please verify" | mail -s "Not Mounted" "producttesting@spire2grow.com" < /opt/s2g/scripts/test_pingtwo.log
fi
When the nfs was switched off the /proc/mounts still had the entry of 192.168.2.7! How to refresh this ? Isnt it supposed to refresh automatically?

This is the line present in /proc/mounts -
Code:
 192.168.2.7:/DataVolume/app_bkp /data/app_bkp nfs rw,vers=3,rsize=16384,wsize=16384,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=192.168.2.7 0 0
 
Old 03-28-2012, 03:24 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,577

Rep: Reputation: 2816Reputation: 2816Reputation: 2816Reputation: 2816Reputation: 2816Reputation: 2816Reputation: 2816Reputation: 2816Reputation: 2816Reputation: 2816Reputation: 2816
yes, you can switch that host off, the mount status will not be changed. I think you would try automounter...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Mount expression not working in nautilus script thund3rstruck Programming 8 05-21-2011 10:21 PM
I'm working with symlinks with mount command to mount remote shares lhorace Linux - Newbie 1 11-21-2009 04:05 PM
rc script to mount filesystem not working? ginda Linux - Security 3 12-01-2006 07:28 PM
Help writing script file to mount / mount hard drive Rustylinux Linux - General 6 06-27-2006 09:34 AM
SCRIPT: check if auto-mount mount-points are still mounted markus1982 Linux - Software 0 05-25-2003 05:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration