NEW ZM ZUTOCLEAN SCRIPTS FOR EVENTS

Support and queries relating to all previous versions of ZoneMinder
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

NEW ZM ZUTOCLEAN SCRIPTS FOR EVENTS

Post 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
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post by victor_diago »

hi again. i put it into the user contributions.


enjoy


victor diago
User avatar
fernando
Posts: 240
Joined: Thu Jul 10, 2003 6:00 pm

Post by fernando »

victor the latest zm do this with the filters. disk%
Fernando
djsb
Posts: 53
Joined: Mon Apr 05, 2004 2:50 am

Post 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..
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post 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
User avatar
l8nite4me
Posts: 36
Joined: Sun May 09, 2004 4:29 am
Location: US Alabama

Post 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
djsb
Posts: 53
Joined: Mon Apr 05, 2004 2:50 am

Post 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.
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post 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
User avatar
davide
Posts: 78
Joined: Mon Mar 22, 2004 1:04 am
Location: Italy

Post 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.
djsb
Posts: 53
Joined: Mon Apr 05, 2004 2:50 am

Post 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.
lorenzo
Posts: 6
Joined: Thu Apr 15, 2004 1:47 pm
Location: france

Post by lorenzo »

you talk about user contribution ... no path or url for it ?
please

thanks
Lorenzo
User avatar
nugget
Posts: 42
Joined: Mon Dec 08, 2003 7:52 pm
Location: Sydney, Australia
Contact:

Archive script

Post 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?
User avatar
floyd_2
Posts: 13
Joined: Thu Jul 22, 2004 1:34 am

Post 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
User avatar
victor_diago
Posts: 245
Joined: Wed Jan 21, 2004 2:44 pm
Location: Brazil, sao paulo
Contact:

Post 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
User avatar
nugget
Posts: 42
Joined: Mon Dec 08, 2003 7:52 pm
Location: Sydney, Australia
Contact:

Post 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
Locked