Recent versions of ZoneMinder come with a filter you can use for this purpose already included. However by default it is not enabled for event deletion.
The filter is called PurgeWhenFull and to find it, choose one of the event counts from the console page, for instance events in the last hour, for one of your monitors.
This will bring up an event listing and a filter window.
In the filter window there is a drop down select box labeled 'Use Filter', that lets your select a saved filter. Select 'PurgeWhenFull' and it will load that filter.
Make any modifications you might want, such as the percentage full you want it to kick in, or how many events to delete at a time (it will repeat the filter as many times as needed to clear the space, but will only delete this many events each time to get there).
Then click on 'Save' which will bring up a new window. Make sure the 'Automatically delete' box is checked and press save to save your filter. This will then run in the background to keep your disk within those limits.
After you've done that, you changes will automatically be loaded into zmfilter within a few minutes.
Check the zmfilter.log file to make sure it is running as sometimes missing perl modules mean that it never runs but people don't always realize.
|