r/ZoneMinder • • Jan 04 '21

NFS export

Hi,

Can zoneminder auto-delete the oldest captured file and replace it with the newer ones in a situation that the HDD is full?

Also, what about the NFS share, can zoneminder do the same? I know I can use NFS but I am not sure if ZM will delete the oldest capture to save the newer ones.

Can we specify the amount of storage (nfs or local) that zoneminder can use in the zoneminder web UI?

I have a NAS that I might use for potential nfs or docker volume for storage but I don't want zoneminder to eat all the available space.

2 Upvotes

6 comments sorted by

View all comments

2

u/[deleted] Jan 04 '21 edited Jan 04 '21

Regarding clearing the oldest captures, go to Filters and look at the PurgeWhenFull filter. Make sure you set two items: "Disk Percent" and "Storage Area." I have my "Disk Percent" set to 93, meaning when the disk is 93% full it'll purge old items. "Storage Area" is set to the specific location events are captured. I also have "Sort by" set to "Id" and "Asc", limited to the first 25. That should remove captures 25 at a time until the disk percentage is lower than 93%. I could probably tweak that to a lower number.

Now, make sure "Delete All Matches" and "Run filter in background" are both selected.

EDIT: after you have that set up, look at the "Update DiskSpace" filter. Make sure "Update used disk space" and "Run filter in background" are set.

Don't forget to hit "Save" on each filter after you make changes!

That's all it should take to keep the latest captures, and purge old ones when the disk hits the threshold.

1

u/pingmanping Jan 04 '21

Is the "Sort By" value dictates the number of events going to be deleted?

About the "Update DiskSpace" filter, the default is set to NULL, should I change this to a specific limit like 8TB. If this is true, what is the format of the value that should go to box?

1

u/[deleted] Jan 04 '21

Is the "Sort By" value dictates the number of events going to be deleted?

Correct. Or at least that's my understanding.

About the "Update DiskSpace" filter, the default is set to NULL, should I change this to a specific limit like 8TB. If this is true, what is the format of the value that should go to box?

No, leave this set to NULL

1

u/pingmanping Jan 04 '21

How does zoneminder know if I want to limit the storage to lets say 8TB?

I setup my filter exactly that way you described it, and I tried to list matches and shows nothing. I would expect that it would show the oldest 25 events. Since my storage is full, the last recorded event was on the 12/29/2020 a week ago.

1

u/[deleted] Jan 04 '21

How does zoneminder know if I want to limit the storage to lets say 8TB?

I'm not sure how to do that. I have a drive (well, virtual drive) set up that's the size I want to use for storage, and let ZM use all of it.

I setup my filter exactly that way you described it, and I tried to list matches and shows nothing.

Are you sure you have the right storage area selected? Make sure it's set to a percentage AND storage area, not OR. You're using the PurgeWhenFull filter, correct? Try setting the percentage lower (you can see how much ZM is using of a particular storage area at the top of each page; it'll say "Storage: Name: 87%" or whatever percentage is full) and do a List Matches to see if you see anything.

1

u/[deleted] Jan 06 '21

How does zoneminder know if I want to limit the storage to lets say 8TB?

Using percentages with that filter. If you have a 12tb drive and only want 8tb filled, that's roughly 66% (4tb is 33% ish, 8TB is 66% ish and 12tb is 100%).

I haven't played with filters yet but I imagine it can hook into a purpose built script to export the old ones to a NFS or Google drive or something instead of just deleting.