If I want to run a script on my externally hosted server to mark me if my disk space is getting low, what's the simplest way to do it?
Say I want a report if "df" reports more than 90% used, I want the script to run regularly but not send an email every time it runs if the problem hasn't worsend, and want to include the output from 'du -h' in the email?
Then, once I have that sorted, what's the "best" way to do this kind of thing?
Oh, and what's the best way to work out *why* I only have 1% left on my server?
-- Mark Rogers More Solutions Ltd :: 0845 45 89 555
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
df | awk '/dev/ && $3 > 0 && ($3 / $2 * 100) > 85 { print $6,"is",$5,"full [",$3,"/",$2,"=",$4,"free]" } ' | mail -s $subjectofmail $persontomail
Cheers
Stuart