Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NFS mounts

Status
Not open for further replies.

icu812

MIS
Sep 10, 2001
52
US
I need to write a script that will NFS mount 5 filesystems onto a host machine(AIX4.3.3). Before it mounts them I need the script to check to see whether or not they are already mounted, if they are not then I need the script to go ahead and mount them. Does someone already have a script that does this that they are willing to share? Can someone offer some advice???? Thank You very much
 
icu,

Well simply:

Add the filesystems to a file i.e.:

more /scripts/nfs_mounts

/backup
/test
/db2

Then use this as an input file:

#!/bin/ksh
for fs in `cat /scripts/nfs_mounts`
do
df -k $fs
if [ $? != 0 ];
then
echo "Attempting to mount filesystem $fs"
mount host:/filesystem /mount_point
else
echo "filesystem $fs alredy mounted"
fi
done


Thats it done simply....

Best of luck.

PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top