Page 1 of 1

keep zoneminder record for 1 month

Posted: Tue Dec 07, 2010 3:54 pm
by sejay
Hi, I have been trying to find out how can I keep the zoneminder record for 1 month, does anyone know? Thank you.

Posted: Tue Dec 07, 2010 9:04 pm
by DREMA
What you mean? ZM keeps all your events until you run out of space, or have some filters enabled. Could you be more specific?

Posted: Wed Dec 08, 2010 3:33 am
by sejay
sure, I have 3 cameras attached to zoneminder and running 24x7. (I have 1 tb gig hard drive). I would like the zoneminder to delete all the events every month and starts fresh. Is this somethng that I can do w/ the filter stuff you mentioned? If so, can you pls let me know where is that in the UI? Thank you.

Posted: Wed Dec 08, 2010 6:34 am
by Flash_
As far as I know not possible through zoneminder itself.

However;

You could write a script that issues a few mysql commands to empty the database of events. Zmaudit would then automatically remove the orphaned image files.

Posted: Wed Dec 08, 2010 7:43 am
by jdhar
sejay wrote:sure, I have 3 cameras attached to zoneminder and running 24x7. (I have 1 tb gig hard drive). I would like the zoneminder to delete all the events every month and starts fresh. Is this somethng that I can do w/ the filter stuff you mentioned? If so, can you pls let me know where is that in the UI? Thank you.
Just like Flash_ said... if you want to start 'fresh' as you put it, it's easy.. just need to delete all events. For example.

echo "delete from Events where 1" | mysql -u<dbuser> -p<dbpass> zm
zmaudit.pl

Stick that in a cron job to run every month and you're good to go. Don't recommend this particularly however since it will start 'fresh', and anything significant that happens right before the deletion will likely be missed. Could setup a daily cron-job to delete a 1 month window as an alternative.

Posted: Fri Dec 10, 2010 8:39 pm
by zendev
sejay wrote:sure, I have 3 cameras attached to zoneminder and running 24x7. (I have 1 tb gig hard drive). I would like the zoneminder to delete all the events every month and starts fresh. Is this somethng that I can do w/ the filter stuff you mentioned? If so, can you pls let me know where is that in the UI? Thank you.
Hi sejay,

Is there any particular reason you need to remove all the files and start fresh each 30 days? Through another board discussion on here (don't feel like hunting) I set up a filter so that anything over X days is auto-deleted from the system because I need to maintain 95 days worth of footage at all times.

Steps:
1. open filter window
2. First field "Use Filter" leave set to "Choose Filter"
3. Second field set to "Date/Time"
4. Third field set to "Less than"
5. Fourth Field set to " -30 day " (without quotes)
6. Click the "+" to add another parameter line
7. Fifth field set to "and"
8. Sixth field set to "Archive Status"
9. Seventh field "Unarchived Only"
10. Set "Sort by" to "Id" and "Asc"
11. Set "Limit to first "20" results only"
12. Select "Delete all matches" check box
13. Click "Save"
14. Assign the filter a name
15. Select "Run filter in background"
16. Save.

Its a very simple way to keep things from growing out of control and maintain a set number of days.

Ryan