disk space check
Hi,
I'm new to scripting so I'm trying to find a script that'll check disk space for let's say something above 65% usage. If that's the case then send me an e-mail. And possibly go out and clean the dir. Thanks in advance for any help you guys can give me. L.M |
This is just a generic idea.
Code:
#!/bin/sh -- BTW I'd be against automagical deletion, unless it's a tempdir. In that case you don't want a script but run "tmpwatch" instead. * I've been lazy and used a temporary file for pretty printing instead of an array. Besides that this script doesn't handle exclusions which it should. Aww well. |
Code:
df -k | awk 'int($5) > 95 { |
good stuff.
Quote:
cmd | getline #or system(cmd) === what is this line doing? |
thanks but I can't read /bin/sh
Quote:
|
He's using the while syntax:
Code:
while sometest do check usage vs theshold, if thresh exceeded, output fact done pipe results through tab separators, redirect formatted result to tempfile HTH |
Quote:
Code:
# df -k | awk 'int($5) > 50' Quote:
|
All times are GMT -5. The time now is 03:17 AM. |