[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to remove files when the monitoring space goes beyond the expect
From: |
Martin Pala |
Subject: |
Re: how to remove files when the monitoring space goes beyond the expected range |
Date: |
Wed, 10 Apr 2013 19:44:45 +0200 |
Hi,
you can use the monit's "exec" action on the space usage match with custom
script, which will find and delete the files, for example (not tested):
if space usage > 99% then exec "/bin/bash -c '/usr/bin/find /mydata/
-type f -mtime +30 -exec rm -f {} \;'"
Regards,
Martin
On Apr 10, 2013, at 5:41 PM, "Nancy Jayakumar" <address@hidden> wrote:
> <nautronixlogo.jpg>
> Hi ,
>
> I would like to know how to delete or remove files that are 30 days older
> when the disk space under monitor
>
> Goes over the limit that i had quoted in the if loop ??
>
> I used the exec with the path and the remove command inside the quotes but
> it doesn’t seem to work
>
> I read one of the online reply for exec to remove, it talks about the bin,
> how does it work in this context ?
>
> If i do not have any bin or i cannot create one?
>
>
>
> Nancy Jayakumar
> Software Engineer
> Tel: +44 (0) 1224 775700
> Fax: +44 (0) 1224 775800
> Email: address@hidden
> Website: www.nautronix.com
> <316055f.jpg>
> <nautronixfooter.jpg>
> This email is sent and received in accordance with the terms and conditions
> as defined on our website. To view click here
> Nautronix Limited is head-quartered at Ury House, Howe Moss Cres, Kirkhill,
> Dyce, Aberdeen, AB21 0GN. Nautronix is part of Nautronix Group Limited which
> is registered in Scotland, registered office: Blackwood House, Union Grove
> Lane, Aberdeen, AB10 6XU. Registered Number: SC372837.Nautronix Limited which
> is registered in Scotland, registered number SC062293, with a registered
> office at Blackwood House, Union Grove Lane, Aberdeen, AB10 6XU is part of
> Nautronix Group Limited. Nautronix (Holdings) Limited which is registered in
> Scotland, registered number SC225116, with a registered office at Blackwood
> House, Union Grove Lane, Aberdeen, AB10 6XU is part of Nautronix Group
> Limited.
> ---------------------------------------------------------------------
> This email has been scanned for Nautronix Ltd,
> by the Postini Message Security System.
> ---------------------------------------------------------------------
> --
>
> To unsubscribe:
> https://lists.nongnu.org/mailman/listinfo/monit-general