Howto store available drive space to a variable for script evaluation
Posted on 2002-04-30
Question: How can I capture available diskspace information in a script and depending on the value perform actions?
Ideally I'd like a working example of the following pseudo-code:
Set AvailSpace = awk/sed/parse and store to var number
if $AvailSpace > 333800 then
Some jobs are failing due to insufficient drivespace.
This is an old process running on an old box with operating system of:
SunOS Release 4.1.3
I've got a partial clue on how to manually see the value:
JoeUser/usr/local% df | tail -1
/dev/sd2a 963662 581656 333823 64% /work
I'm just not sure how to assign the value '333823' to a variable for
Any thoughts would be appreciated.