Filter to delete events more than 24 hours old

Forum for questions and support relating to the 1.29.x releases only.
Locked
johnaaronrose
Posts: 44
Joined: Tue Feb 27, 2018 9:27 am

Filter to delete events more than 24 hours old

Post by johnaaronrose »

I don't understand how to do this. I've set the name of the filter to Last 24 Hours. I've used Date/Time with "Less than" and "-24 hour". I've also tried replacing "-24 hour" by "now -24 hour". When I execute the filter, it deletes all events.
John
mikb
Posts: 585
Joined: Mon Mar 25, 2013 12:34 pm

Re: Filter to delete events more than 24 hours old

Post by mikb »

This seems to happen to a lot of people :)

I think "less than" means "before" and "-24 hours" is "in the future". You work out what the result there is.

I found that I got this to work with :-

"Archived Status" equal to "Unarchived Only"
"and" "Date" "less than" "24 hours ago"

(note the time syntax -- I know in ENGLISH something that happened "less than 24 hours ago" is within the last day, i.e. "up to 24 hours ago", but in ZoneMinder, "less than" is smaller/earlier times and "more than" is bigger/later times in a mathematical sense)

... with a side order of "Sort by" "Date/Time" "Asc" and "Limit to first" "50" results only ... to reduce the amount of activity when running a delete pass.
johnaaronrose
Posts: 44
Joined: Tue Feb 27, 2018 9:27 am

Re: Filter to delete events more than 24 hours old

Post by johnaaronrose »

What is the point of the "Archived Status" line? I've just tried "date" "less than" "24 hours ago" and it didn't delete the events just done. So that elemnet works Ok. It also seems to me that the "Sort by" & "Limit to first" lines are not required as there are currently only a few events and I presume that the filter will by default run every 300 seconds. Is that correct?
John
mikb
Posts: 585
Joined: Mon Mar 25, 2013 12:34 pm

Re: Filter to delete events more than 24 hours old

Post by mikb »

Point of "Archived Status" -- *I* want to expire unarchived (boring) events after 7 days or when disk is getting full. Separate rule exists that says expire archived ones at 14 days and never mind the disk space -- "archived" ones are ones being converted to video for keeping, and get to stick around longer.

You may or may not want to bother with that, but be aware :)

If you are running the filter often and there are few events, then it's probably ok for you. I had to limit how much deletion went on to stop it bogging the machine down too much, it evens up the disc access, instead of a massive blast of deletion at midnight, or exactly (n*24 hours) after a busy time of day created lots of events -- to match the busy time right now feeding more in. It works for me!
Locked