Help with PurgeWhenFull

Forum for questions and support relating to the 1.24.x releases only.
Locked
jwinius
Posts: 5
Joined: Sun Sep 30, 2012 10:57 pm

Help with PurgeWhenFull

Post by jwinius »

Hi folks,

Although the principal regarding use of the PurgeWhenFull filter seems clear enough to me, I am not sure of the details. What I want is to create a filter that automatically deletes unarchived events after one day, but I'm not sure how to express this. I saved my PurgeWhenFull filter configuration as "DeleteAfter24Hours" and it currently looks like this:

Use filter DeleteAfter24Hours* [background]
Archive Status equal to Unarchived Only
and Time greater than or equal to 24 hours
Sort by Id Asc Limit to first 100 results only
Archive all matches _
Create video for all matches _
Execute command on all matches _
Delete all matches v

I filled in "24 hours", but I'm worried that this is incorrect. What is required in this case? Should the time value only be given in seconds (or minutes, or hours, or days), or is it enough to specify the unit or measure as I've done above?

For me, this configuration resulted in all unarchived events being deleted, but in less than 24 hours.

Thanks,

Jaap
Christo
Posts: 89
Joined: Wed Feb 01, 2012 9:48 pm

Re: Help with PurgeWhenFull

Post by Christo »

jwinius wrote:Hi folks,

Although the principal regarding use of the PurgeWhenFull filter seems clear enough to me, I am not sure of the details. What I want is to create a filter that automatically deletes unarchived events after one day, but I'm not sure how to express this. I saved my PurgeWhenFull filter configuration as "DeleteAfter24Hours" and it currently looks like this:

Use filter DeleteAfter24Hours* [background]
Archive Status equal to Unarchived Only
and Time greater than or equal to 24 hours
Sort by Id Asc Limit to first 100 results only
Archive all matches _
Create video for all matches _
Execute command on all matches _
Delete all matches v

I filled in "24 hours", but I'm worried that this is incorrect. What is required in this case? Should the time value only be given in seconds (or minutes, or hours, or days), or is it enough to specify the unit or measure as I've done above?

For me, this configuration resulted in all unarchived events being deleted, but in less than 24 hours.

Thanks,

Jaap

Hello Jaap,

I think this post will help you out!!
http://www.zoneminder.com/forums/viewto ... 29&t=19401

Kind regards, Christo
jwinius
Posts: 5
Joined: Sun Sep 30, 2012 10:57 pm

Re: Help with PurgeWhenFull

Post by jwinius »

Hi Christo,

Thanks for your reply. The exchange you refer to suggests that Date/Time values of -#hour, -#day and -#month are possible. So, I tried this:

Use filter DeleteAfter24Hours* [background]
Archive Status equal to Unarchived Only
and Date/Time greater than or equal to -1day
Sort by Id Asc Limit to first 100 results only
Archive all matches _
Create video for all matches _
Execute command on all matches _
Delete all matches v

Unfortunately, it ended up deleting all of my events, including those created within the last hour.

Cheers,

Jaap
Christo
Posts: 89
Joined: Wed Feb 01, 2012 9:48 pm

Re: Help with PurgeWhenFull

Post by Christo »

jwinius wrote:Hi Christo,

Thanks for your reply. The exchange you refer to suggests that Date/Time values of -#hour, -#day and -#month are possible. So, I tried this:

Use filter DeleteAfter24Hours* [background]
Archive Status equal to Unarchived Only
and Date/Time greater than or equal to -1day
Sort by Id Asc Limit to first 100 results only
Archive all matches _
Create video for all matches _
Execute command on all matches _
Delete all matches v

Unfortunately, it ended up deleting all of my events, including those created within the last hour.

Cheers,

Jaap
Hello Jaap...

Ill get your point.. but "greater than or equal to" -1 day... means from startpoint... back in time for one day..
So, in fact.. ZoneMinder is doing what it's told to do..deleting all...

So.. if you like to have a full day of data left in your ZoneMinder database... you should use "less than" -1 day
To keep your systemload stable I suggest to reduce the resultlimit to 10 or so.

Goodluck...Christo
jwinius
Posts: 5
Joined: Sun Sep 30, 2012 10:57 pm

Re: Help with PurgeWhenFull

Post by jwinius »

Hi Christo,

After my "-1day" test that didn't go too well, I tried out "24hour". Predictably, this had the same outcome as my original setting: not everything got deleted immediately, but all the unarchived events got deleted within nine hours in a mass-deletion event shortly after midnight. Well, at least the archived events didn't get deleted (BTW, the "Unarchive" button doesn't seem to work).

As per your suggestion, I've now configured the system with "less than" and "-1day" with the results limited to the first ten. Hopefully tomorrow's events will not be deleted until 24 hours have passed for each of them. I'll let you know.

Cheers,

Jaap
Christo
Posts: 89
Joined: Wed Feb 01, 2012 9:48 pm

Re: Help with PurgeWhenFull

Post by Christo »

jwinius wrote:Hi Christo,

After my "-1day" test that didn't go too well, I tried out "24hour". Predictably, this had the same outcome as my original setting: not everything got deleted immediately, but all the unarchived events got deleted within nine hours in a mass-deletion event shortly after midnight. Well, at least the archived events didn't get deleted (BTW, the "Unarchive" button doesn't seem to work).

As per your suggestion, I've now configured the system with "less than" and "-1day" with the results limited to the first ten. Hopefully tomorrow's events will not be deleted until 24 hours have passed for each of them. I'll let you know.

Cheers,

Jaap
Hello Jaap,
I assume you are still running the 1.24 version... so look for bugfixes at the following link:
http://www.zoneminder.com/wiki/index.ph ... ther_fixes

Most important is that youll understand why your settings didn't work...
And... my suggestion will work, don't worry:)

BTW.. in your reply.. your are using the -1day string... this should be...-1 day

Goodluck, Christo
jwinius
Posts: 5
Joined: Sun Sep 30, 2012 10:57 pm

Re: Help with PurgeWhenFull

Post by jwinius »

Hi Christo,

Yes, I'm running v1.24.2 on Debian squeeze. Regarding the bugfixes, I downloaded the Debian source package for 1.24.2, applied just about all of the fixes, recompiled, installed and have since encountered fewer errors and warnings in the logs and problems in general.

Your suggestions for the filter settings worked. However, there was possibly one minor issue. Yesterday, before close of business, somebody cut power to the IP camera. So I stopped ZoneMinder to prevent it from writing endless "Unable to connect to camera" errors to the syslog. Then today, I forgot about ZoneMinder and only started it early in the afternoon. At that point there were many events from yesterday morning that were older than 24 hours. I expected it to quickly delete those events, but after an hour it still had not. I then deleted them manually, after which I saw that the rest was slowly being deleted on schedule.

So, might this mean that the current filter is not able to delete events that have aged 25 hours or more, or should I simply have been more patient?

Cheers,

Jaap
Christo
Posts: 89
Joined: Wed Feb 01, 2012 9:48 pm

Re: Help with PurgeWhenFull

Post by Christo »

jwinius wrote:Hi Christo,

Yes, I'm running v1.24.2 on Debian squeeze. Regarding the bugfixes, I downloaded the Debian source package for 1.24.2, applied just about all of the fixes, recompiled, installed and have since encountered fewer errors and warnings in the logs and problems in general.

Your suggestions for the filter settings worked. However, there was possibly one minor issue. Yesterday, before close of business, somebody cut power to the IP camera. So I stopped ZoneMinder to prevent it from writing endless "Unable to connect to camera" errors to the syslog. Then today, I forgot about ZoneMinder and only started it early in the afternoon. At that point there were many events from yesterday morning that were older than 24 hours. I expected it to quickly delete those events, but after an hour it still had not. I then deleted them manually, after which I saw that the rest was slowly being deleted on schedule.

So, might this mean that the current filter is not able to delete events that have aged 25 hours or more, or should I simply have been more patient?

Cheers,

Jaap
Hello Jaap,

To be short..youll have to be (more) patient however..
I do not know how many events are generated within 24 hours on your system.

I have a few systems running that are generating about 700 events per day each.

The main job of your ZoneMinder box is to detect and record events according your settings.
To keep te load stable ... I suggested to set the results on your PurgeWhenFull filter to 10.

Did you check your systemload.. Munin?

If the suggested result quantity didn't increase your systemload drameticallly you can increase this quantity.
The filter deamon runs in the background and will take care of removing these records....but this depends on how busy your system is. (if your load is high.. the filterdeamon has less time to delete your records.
So, youll have to find the balance between the capabilities of your system and the total workload!

You can also do both.. increasing result quantity, and add a rule on systemload to your PurgeWhenFull filter.
s.a. less that 2.00

Again some homework:)

Goodluck and regards, Christo
jwinius
Posts: 5
Joined: Sun Sep 30, 2012 10:57 pm

Re: Help with PurgeWhenFull

Post by jwinius »

Hi Christo,

The system load is fine, although it was the first issue I had to address! Also, the max. results number was set back to 10 on Tuesday. But, yeah, next time I'll just have to be more patient.

Thanks!

Jaap
Locked