Dear All,
Using v1.32.3 on Debian Stretch and an nfs mount /zoneminder (permissions 755, www-data:www-data), included in a config file indicating this path under /etc/zm/, the UI does show a plausible space: "storage DB:16/151 Storage: Default: 77%, Default: 30% /dev/shm: 48%" means that 77 % of /zoneminder is full. Filters work in general, for example I can delete recordings with a startdate earlier than X.
What does not work is PurgeWhenFull. This does always evaluate "Default", not "Storage: Default". I did read many postings without finding a solution. Can someone please be so kind to indicate briefly how to proceed? If there is no way to get PurgeWhenFull working in this case, a script deleting content older than X days would also work. There, the challange seems to be to compute the relative date from scratch every time the srcipt runs.
Regards,
Michael Schefczyk
PurgeWhenFull nfs
Re: PurgeWhenFull nfs
You need "find", a bucket of popcorn, and a read of the extremely detailed manpage for itmichael.schefczyk wrote: ↑Mon Sep 30, 2019 9:43 pmThere, the challange seems to be to compute the relative date from scratch every time the srcipt runs.
Something like (example only!)
Code: Select all
find /path/to/zm/events -type f -iname "*.jpg" -ctime +5 -delete
So it's a very good idea to test things like this with -print instead, first, to see what matches, while you are setting up the rules.
Also look at options for -cmin (works in minutes, not days) -mtime -mmin (last modified times) and look at -daystart if you think your number of days isn't quite what you wanted. Good luck!
-
- Posts: 4
- Joined: Mon Sep 30, 2019 9:29 pm
Re: PurgeWhenFull nfs
Thank you very much. I am able to work with "find". If I delete just the files, DB entries will remain. I have zmaudit running in the background. Is that sufficient to ensure that the database gets cleaned up in due time?
Re: PurgeWhenFull nfs
Ideally, fix the problem with ZM, going on with find and nuking files is a sticking plaster, however ...michael.schefczyk wrote: ↑Wed Oct 02, 2019 4:22 pm Thank you very much. I am able to work with "find". If I delete just the files, DB entries will remain. I have zmaudit running in the background. Is that sufficient to ensure that the database gets cleaned up in due time?
If ZMaudit is running, it will purge the database entries where files no longer exist, and v. versa.
I'm not sure if it will clean up any empty directories (depending on how your files are stored, there may be empty directories left behind by "find" -- that's a job for another find script
I use something like this for cleaning up empty (abandoned) directories in a non-ZM context :-
Code: Select all
find /mnt/place/base -type d -empty
Code: Select all
/mnt/place/base/camera/month/day/hour/minute/second/*.jpg