Trying to test for OS and space in filesystem on AIX

Posted by Buzkie on Stack Overflow See other posts from Stack Overflow or by Buzkie
Published on 2010-03-22T18:38:21Z Indexed on 2010/03/22 18:41 UTC
Read the original article Hit count: 282

Filed under:
|
|

I need to check if I Filesystem exists, and if it does exist there is 300 MB of space in it.

What I have so far:

if [ "$(df -m /opt/IBM | grep -vE '^Filesystem' | awk '{print ($3)}')" < "300" ]
then
   echo "not enough space in the target filesystem"
   exit 1
fi

This throws an error. I don't really know what I'm doing in shell.

Please help.

-Alex

© Stack Overflow or respective owner

Related posts about shell-scripting

Related posts about shell