NEW ZM ZUTOCLEAN SCRIPTS FOR EVENTS
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
NEW ZM ZUTOCLEAN SCRIPTS FOR EVENTS
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
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
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
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..
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..
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
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
post comments please people, i will be very happy to know what
do you think about all this
victor diago
accidentaly a user could remove the filter, then bye bye feature.
also, i had promissed the script since my first post
hope you enjoy
post comments please people, i will be very happy to know what
do you think about all this
victor diago
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
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.
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.
Archive script
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?
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?
- victor_diago
- Posts: 245
- Joined: Wed Jan 21, 2004 2:44 pm
- Location: Brazil, sao paulo
- Contact:
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
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
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
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