[asterisk-users] Cron Job to Drop a Call File When the Hard Drive
Gets over 50% Full
Massimiliano Stucchi
stucchi at willystudios.com
Mon Aug 14 12:53:35 MST 2006
On 140806, 15:35, Steve Totaro wrote:
> Anyone have a script or example to do this? I want to run the script
> every so often and then drop a call file into the outgoing folder and
> call multiple numbers. I figured I would ask before wasting my time
> re-inventing the wheel.
>
> Also, I dont want to setup nagios or any other system right now, I just
> want a down and dirty df script.
df | awk 'BEGIN{pippo=1} {if (pippo == 5) { sub("%","",$5); if ($5 > 50) \
{print $5; print "Ci siamo !"; \
system("cp call.file /var/spool/asterisk/outgoing/");} } pippo++}'
Quick and dirty.
This works perfectly on a FreeBSD system.
By the way, you have to modify the first occurrence of the if statement
to match the line where you have the filesystem you care about. Yes,
it's middle august, I'm too tired and it's too hot to think of a good
regexp, sorry.
Ciao !
--
Massimiliano Stucchi, CTO & Director of Operations
WillyStudios.com - IT Consulting, Web and VoIP Services
stucchi at willystudios.com | Tel (+39) 0244417203 | Fax (+39) 0244417204
IT-20040, Carnate (Milano), via Carducci 9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20060814/4debb4bd/attachment.pgp
More information about the asterisk-users
mailing list