Page 1 of 2

NEW ZM ZUTOCLEAN SCRIPTS FOR EVENTS

Posted: Tue Jun 29, 2004 7:42 pm
by victor_diago
hi all. its ready my new autoclean scripts for events.

it cleans the oldest day when your free amount of disk goes under a limit defined by you.


this new version is VERY FASTER than oldest one, and it doesnt delete Archived Events, this is pretty good since 1.0 delete even archived ones.

i will try to put it for download here, if i cant i will cut the code and paste here.


its a shell file and you should run it every 30 minutes.

victor diago

Posted: Tue Jun 29, 2004 7:48 pm
by victor_diago
hi again. i put it into the user contributions.


enjoy


victor diago

Posted: Tue Jun 29, 2004 8:31 pm
by fernando
victor the latest zm do this with the filters. disk%

Posted: Tue Jun 29, 2004 10:38 pm
by djsb
Fernando, i guess the filters only allow to select the events and then manually hit the delete button...

I have a 32 cameras with almost a milion events and it could be quite painfull to do it... Internet Explorer or Mozilla Firefox all crash when i select view all if i want to delete more than 3000 events at a time..

Posted: Wed Jun 30, 2004 12:00 am
by victor_diago
i know zm could do that, but i think this is a better way to do that.

accidentaly a user could remove the filter, then bye bye feature.


also, i had promissed the script since my first post

hope you enjoy :wink:

post comments please people, i will be very happy to know what
do you think about all this


victor diago

Posted: Wed Jun 30, 2004 2:12 am
by l8nite4me
djsb wrote: I have a 32 cameras with almost a milion events
djsb,

If you don't mind me asking, would you describe your setup that you have running 32 cameras. Processor, memory, hard drive, etc. Would be curious to see the info.

Thanks
John

Posted: Thu Jul 01, 2004 3:12 pm
by djsb
I have a Linux Distro built by myself, using 128MB of harddisk space.

I have 250GB for storage on raid 5 ultra SCSI devices (scsi is important when you have a lot of cameras saving data at the same time).

4GB of ram.

Posted: Thu Jul 01, 2004 9:27 pm
by victor_diago
i have made a little fix for the script. look at user contributions and copy the code again,

there i explain the issue

victor diago

Posted: Fri Jul 02, 2004 8:55 am
by davide
hi djsb,
How did you do your distro? Did you build Linux From Scratch?
I am trying to do the same..
I think it would be very helpfull if you would post a short (better a long) description of what you did and how you did it.
the "Hints & Tips" or "Non-ZoneMinder Chat" would be appropriate forums for such a topic.
I'd really appreciate it.

regards,
davide.

Posted: Fri Jul 02, 2004 11:52 am
by djsb
Ok. I'm going to build an explaining text and put it on the user contribs.
I'm short on avaiable time, but i'll do it somewhere in the next week.

Posted: Wed Jul 21, 2004 12:17 pm
by lorenzo
you talk about user contribution ... no path or url for it ?
please

thanks
Lorenzo

Archive script

Posted: Thu Jul 22, 2004 7:39 am
by nugget
I have a script which will archive ZM events. If anyone is interested I'll clean it up a bit, and post it on the contrib board.

Currently the script is written for my purposes, and does the following:
* any event older than 14 days is considered a candidate for archival.
* the script creates a listing of events, start, stop times, and monitor name
based on the above list, all captured frames for each event are moved into a separate "archive folder" (/usr/local/archive/zoneminder/'Month''Year'/'Monitor-name' in my case)
* once archived the event records are removed from the database.

I run this script once a week from cron.

The idea is to allow cron to clean the database up, and at the end of the month either:
a. write the contents of the archive directory to CD/DVD/removable media and delete it, or:
b. delete the archive directory when you no longer need it.

As I said, currently written for my purposes, so the first release might not be pretty.

Who wants it?

Posted: Sat Jul 24, 2004 11:24 am
by floyd_2
Nugget,
your script sounds like a gem. If you can be bothered posting it, I'd love to take a look. I was about to start writing a cleanup script myself, and then thought I'd hit the forums to see if I was reinventing the wheel.

Floyd

Posted: Sat Jul 24, 2004 11:39 am
by victor_diago
Amazing. this could be very good.

why dont we make an all-in-one script that do both, backup the old events or delete all then when free disk amount goes under XX MB.


It will be very great.

im doing very work now, but in some days i will be entirely free to code.

this could be done with DAVIDE, which wants to develop a better cd writting feature than the webcdWriter.

I think that´s the way.

Victor Diago

Posted: Sat Jul 24, 2004 9:27 pm
by nugget
This script was written for my purposes, and was intended to be used for the following:

1. Reduce the number of events in the zm database to a manageable level, without having to hack through dozens or hundreds of events on a weekly basis

2. Once a collection of archived events has been made (weekly, monthly, etc), then I burn these to DVD for later use (if required). I thought that simply removing an event from the database without saving the data might lose an interesting event - eg someone stalking around my backyard while I was at work might be interesting in 2 weeks time... hence I'd like to keep the data offline.

3. I write in bash, and will eventually learn PERL. Sorry.

I use the term "archive" to mean "purge from the database to offline media", rather than the ZoneMinder concept of archival.

Questions which need to be answered:

1. My html/zm/events directory is on the same filesystem as my archive directory - the mv command is a very efficient way of moving an entire directory to a new path. If archive is on a different filesystem then a more efficient way to move the directory might be needed

2. I run the script as root, and have no user/pass authentication method built into the script - this might need to be changed depending on what your installation looks like.

3. There will be other "localisation" issues which will need to be considered, unfortuntely my experience of Zoneminder limited to my own setup, which is installed and maintained my way.

I like the sound of a "super script" which handles archival, deletion, CD/DVD burning, I'll help in any way I can!

I'll post the code a later on today on the User Contributions forum