lblauen
Technical User
- Aug 13, 2002
- 69
I need someones help. I need a small script that I would run in cron to check filesystems using the df command and if a filesystem is above say 80% put that information in a file that I can email out. But I also need to tell the script to ignore some of the filesystems cause I don't care how full they get.
/dev/hd4 131072 106916 19% 2966 5% /
/dev/hd2 2654208 519648 81% 42513 7% /usr
/dev/hd9var 131072 44148 67% 954 3% /var
/dev/hd3 131072 98904 25% 300 1% /tmp
/dev/hd1 0 0 -1% - - /home
/dev/hd10opt 131072 20488 85% 2646 9% /opt
Like here I would what /usr in the file saying its 81% used but I can tell it to ignore /home and /opt
I would have the output file say something like this:
Following filesystems are getting full Please check.
/dev/hd2 2654208 519648 81% 42513 7% /usr
Can this be done if so how please. Thanks Lloyd
/dev/hd4 131072 106916 19% 2966 5% /
/dev/hd2 2654208 519648 81% 42513 7% /usr
/dev/hd9var 131072 44148 67% 954 3% /var
/dev/hd3 131072 98904 25% 300 1% /tmp
/dev/hd1 0 0 -1% - - /home
/dev/hd10opt 131072 20488 85% 2646 9% /opt
Like here I would what /usr in the file saying its 81% used but I can tell it to ignore /home and /opt
I would have the output file say something like this:
Following filesystems are getting full Please check.
/dev/hd2 2654208 519648 81% 42513 7% /usr
Can this be done if so how please. Thanks Lloyd