delete all events/images

Forum for questions and support relating to the 1.28.x releases only.
Locked
freak
Posts: 112
Joined: Wed May 03, 2006 5:22 pm

delete all events/images

Post by freak »

I'd like to restart a system with no events or images saved on it. There is probably around 50000 events right now. Is there a procedure to follow?
bbunge
Posts: 2930
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: delete all events/images

Post by bbunge »

Well, you could create a filter to delete events down to -1 day then let it run. When it gets down to one day events left delete them manually. Or you could delete your cameras which deletes all associated events. Or you could set purge when full down to 5% and let it run. You could have some events left but lowering the % lower would get rid of them. Also set your cameras to monitor so you are not adding events. I'm sure there is another way...
freak
Posts: 112
Joined: Wed May 03, 2006 5:22 pm

Re: delete all events/images

Post by freak »

I was hoping to do something like "delete from events" and "rm -r /events".
User avatar
knight-of-ni
Posts: 2404
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: delete all events/images

Post by knight-of-ni »

The zmaudit deamon will find orphans and delete them for you.

That means that all you have to do is:

A) delete the events from your local hard drive
-- OR --
B) delete the records from the mysql Events table

All you have to do is one of these, in any manner you know how.
It might take a little bit if you have 50k records, but zoneminder will delete them all.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
freak
Posts: 112
Joined: Wed May 03, 2006 5:22 pm

Re: delete all events/images

Post by freak »

Well I....

truncate table Logs
truncate table Frames
truncate table Events

...and deleted everything in /var/cache/zoneminder.

All looks good! I feel soooo clean now!!!
Locked