Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am looking to make a backup to a remote drive, but I want to do a check prior to doing so.

Is it possible to snatch only the "Available" space from the df output, rather than all of the details, to compare to the size of the dump?

share|improve this question
    
do you have ssh access ot the remote drive's host machine ? I assume yes –  Sirex Jul 8 '11 at 11:58
4  
try: df | grep -i <mount point> | awk '{print $3}' –  Sirex Jul 8 '11 at 12:00

1 Answer 1

Sirex,

I had to change it to $print 4, but that is exactly what was needed. Thank you so much.

share|improve this answer
3  
You can void the use of grep by running df <mountpoint>. Note also that this will fail for long device names, because df will then use two lines of output for the filesystem, which will throw off your column count. You can avoid this -- under Linux -- by running df -P <mountpoint>, which ensures a single line of output per filesystem. –  larsks Jul 8 '11 at 13:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.