The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Taking JPA for a Test Drive iBot Oracle Updates (RSS) 0 04-06-2008 02:10 AM
How to test for a specific file size GEBRAUN UNIX for Dummies Questions & Answers 1 02-20-2006 08:50 AM
Fibre connection Point to Point SUN kie UNIX for Advanced & Expert Users 6 05-20-2003 08:20 AM
how to assign same mount point for file systems mounted on physical disks Hitesh Shah Filesystems, Disks and Memory 6 04-18-2003 11:42 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 05-10-2005
Registered User
 

Join Date: Apr 2005
Posts: 4
Test to see if a drive is mounted at a specific point

I have a script that backs up our storage drive daily to one external drive and weekly to another. What I'd like to do is find a way, in the script, to test whether the drives are mounted so that it doesn't accidentally fill up the main drive in the event of a drive failure, etc. Any ideas on how to accomplish this?
Reply With Quote
Forum Sponsor
  #2  
Old 05-10-2005
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
You can use the df command to get the device associated with a mount.
Check your man page for df as it may not have the -v option I show in the example.

df -v /var |tail -1|awk '{print $2}'
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:01 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0