Recordings

Forum for questions and support relating to the 1.24.x releases only.
Post Reply
JungleGeorge
Posts: 20
Joined: Mon Sep 21, 2009 10:41 pm

Recordings

Post by JungleGeorge » Thu Jan 21, 2010 3:32 am

The setup:
* Ubuntu 9.10
* ZoneMinder v1.24.1
* Axis M1031-W Network Camera
* On a Local Network

Everything was up and running.
So I changed the Function from "Monitor" to "Record".
ZM has started recording 10-minute events.

I am wondering, by default:
1. Where are these recordings located?
2. Will these recordings be rotated?

JungleGeorge
Posts: 20
Joined: Mon Sep 21, 2009 10:41 pm

Post by JungleGeorge » Thu Jan 21, 2010 6:55 pm

Specifically - How do you ensure that ZoneMinder does not consume all the available disk space?

timcraig
Posts: 195
Joined: Mon Dec 10, 2007 5:53 pm
Location: San Jose, CA
Contact:

Post by timcraig » Thu Jan 21, 2010 7:48 pm

The events are stored in the zoneminder web folder. On Ubuntu systems, this is usually in /var/www/zm.

To make sure Zoneminder doesn't fill up your harddisk, you need to enable the "PurgeWhenFull" filter. To do this you need to do the following:
- Click on the 'Filters' button on the Zoneminder Console window
- In the Event Filter window, select 'PurgeWhenFull' in the "Use Filter" selector and click on the 'Save' button.
- In the "Save Filter" window, make sure teh "Run filter in background" check box is checked and press the save button.
- Restart Zoneminder.

When the PrugeWhenFull is set to run in the background, Zoneminder will periodically delete 10 of the oldest, non-archived events whenever the harddisk partition Zoneminder is installed is more than 95% full.

JungleGeorge
Posts: 20
Joined: Mon Sep 21, 2009 10:41 pm

Post by JungleGeorge » Thu Jan 21, 2010 8:56 pm

Thanks. I will try that.

JungleGeorge
Posts: 20
Joined: Mon Sep 21, 2009 10:41 pm

Post by JungleGeorge » Thu Jan 21, 2010 10:27 pm

Ok. The above will be done by ZoneMinder in the background.

Now in the ZoneMinder Console, I clicked on the Total Events number in the bottom row.
I see the Events window.
This shows me all of the Events.
I (manually), clicked on the checkbox in the right column for about 60% of the oldest Events.
Then I clicked on the Delete button.
This deleted 60% of the oldest Events.
Does this mean that the corresponding amount of Disk Space has been released by ZoneMinder?

timcraig
Posts: 195
Joined: Mon Dec 10, 2007 5:53 pm
Location: San Jose, CA
Contact:

Post by timcraig » Fri Jan 22, 2010 12:06 am

Yes,

Zoneminder will release the disk space used to store the deleted events. Most likely you won't see the files deleted on the harddisk right away but they will get deleted eventually.

The default delete mode in Zoneminder is fast delete mode ('OPT_FAST_DELETE' in the system options). In fast delete mode, Zoneminder will only delete the database records of the events when you delete events in the UI. Zoneminder is always checking for events on the hard disk that don't exist in the database and deletes them.

ooglek
Posts: 16
Joined: Tue Sep 23, 2008 9:00 pm

Post by ooglek » Tue Mar 02, 2010 5:38 pm

How do you tell zoneminder to check for events that are not in the DB but remain on disk to delete them now? I'm in a situation where I'm trying to upgrade the base OS, need to free up about 500MB, and the PurgeWhenFull isn't helping because although I've purged about 1000 entries, they remain on disk. Looks like running zmaudit manually will do it, I'll look for docs on how to do that manually.

Not deleting when run in background also seems silly, unless the background Filters ignore the OPT_FAST_DELETE and actually delete, because the whole goal of the PurgeWhenFull Filter running in the background is to take out events in order to get the disk space down. zmaudit (which seems to delete files) happens only every 30 minutes. If I'm running zmfilter every minute (which also seems to be the case), then my filter, which tries to keep deleting to a minimum, will delete a maximum of limit * 30 events, or in my case 150 events, before disk space will be recovered.

Why not add logic to the cron job zmfilter to ignore the OPT_FAST_DELETE since it is not affecting the UI, and so background jobs that do delete also delete the files at the same time, which makes the filter more useful?

ooglek
Posts: 16
Joined: Tue Sep 23, 2008 9:00 pm

Post by ooglek » Fri Mar 26, 2010 6:51 pm

So this is still frustrating. I need to run zmaudit.pl manually after deleting stuff manually using the PurgeWhenFull Filter in order to recover disk space. Plus the fact that the PurgeWhenFull Filter does run it doesn't actually recover the disk space, which it is supposed to.

Since zmfilter.pl is run as a cron job, I suggest one of two things:
  1. Add a new variable called ZM_OPT_CRON_RESPECT_FAST_DELETE and if it is FALSE, it deletes files. If it is TRUE, it uses the FAST_DELETE option to determine if it deletes files.
  2. Remove the ZM_OPT_FAST_DELETE conditional on line 618 of zmfilter.pl
Either of these options would be good for me. Here's the diff:

Code: Select all

--- /usr/local/bin/zmfilter.pl  2009-09-02 21:09:28.000000000 -0400
+++ ./zmfilter.pl   2010-03-25 15:05:34.000000000 -0400
@@ -615,18 +615,15 @@
                 my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );
                 my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() );
 
-                if ( !ZM_OPT_FAST_DELETE )
-                {
-                    my $sql = "delete from Frames where EventId = ?";
-                    my $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );
-                    my $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() );
-
-                    $sql = "delete from Stats where EventId = ?";
-                    $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );
-                    $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() );
+               $sql = "delete from Frames where EventId = ?";
+               $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );
+               $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() );
+
+               $sql = "delete from Stats where EventId = ?";
+               $sth = $dbh->prepare_cached( $sql ) or Fatal( "Can't prepare '$sql': ".$dbh->errstr() );
+               $res = $sth->execute( $event->{Id} ) or Fatal( "Can't execute '$sql': ".$sth->errstr() );
 
-                    deleteEventFiles( $event->{Id}, $event->{MonitorId} );
-                }
+               deleteEventFiles( $event->{Id}, $event->{MonitorId} );
             }
             else
             {
[/list]

Flav
Posts: 38
Joined: Tue Jan 12, 2010 2:26 pm
Contact:

Post by Flav » Fri Mar 26, 2010 11:20 pm

If you install ZM with .deb the web files ares in /var/shared/zoneminder
And events files in /var/caches/zoneminder/events

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests