Filter -- limit the amount of deleted files issue

Current Development version likely to have breaking changes
Post Reply
busymind
Posts: 38
Joined: Fri Jan 03, 2025 9:55 pm
Location: Montreal

Filter -- limit the amount of deleted files issue

Post by busymind »

I have a filter to clean up the storage and works but I had tried to find a way to stop deleting all the videos from storage once a certain limit has reached (Delete progressively from old ones, ex by ID)
The limit seems not working or I miss something. I tried to follow the docs before writing this.

In this example had set a limit for max 3 files on ID order and just list the matches
using firefox browser.
I had put a simple rule to test the limit first:
Screenshot_20250409_214403.png
Screenshot_20250409_214403.png (82.16 KiB) Viewed 1113 times
and list all files, should give me only 3
Screenshot_20250409_214424.png
Screenshot_20250409_214424.png (254 KiB) Viewed 1113 times
my current filter for purge
Screenshot_20250409_215135.png
Screenshot_20250409_215135.png (60.2 KiB) Viewed 1113 times
Last edited by busymind on Thu Apr 10, 2025 2:41 am, edited 9 times in total.
busymind
Posts: 38
Joined: Fri Jan 03, 2025 9:55 pm
Location: Montreal

Re: Filter limit the amount of delete

Post by busymind »

This is with Debug My understanding in sql is, take the column ID and order asc and limit the results to 1 (in this example)
Syntax seems ok ... I do not know what sql server receive from this syntax

Code: Select all

mariaDB: 

SELECT *, M.Name AS MonitorName, M.DefaultScale
FROM Monitors AS M INNER JOIN Events AS E ON (M.Id = E.MonitorId)
WHERE E.Archived = '0' AND TRUE /*DiskPercent*/ AND E.StorageId = '2' ORDER BY Id ASC LIMIT 1;
Screenshot_20250409_215605.png
Screenshot_20250409_215605.png (23.35 KiB) Viewed 1105 times
the filter
Screenshot_20250409_215812.png
Screenshot_20250409_215812.png (22.54 KiB) Viewed 1105 times
IgorA100
Posts: 203
Joined: Sat Feb 03, 2024 11:55 am

Re: Filter -- limit the amount of deleted files issue

Post by IgorA100 »

Here is my working filter that does the following:
- Deletes only unarchived files.
- Deletes from "NAS" storage when more than 89% is occupied
- Deletes from the DB only those files that are in the file system.
- Deletes 300 files at a time (I set a high value here when I needed to quickly clear critical space, but this value remained :) )
- Start interval is 60 seconds.
Attachments
Filter.jpg
Filter.jpg (167.46 KiB) Viewed 874 times
busymind
Posts: 38
Joined: Fri Jan 03, 2025 9:55 pm
Location: Montreal

Re: Filter -- limit the amount of deleted files issue

Post by busymind »

If I understand correctly there's is no function to keep some videos on disk in case something happens and not archived and needed to be retrieved. At the end of the disk space everything will be gone (except archived ones). That limit seems to be for other reason - I do still not get it. Also that version does not seems similar to mine.
IgorA100
Posts: 203
Joined: Sat Feb 03, 2024 11:55 am

Re: Filter -- limit the amount of deleted files issue

Post by IgorA100 »

Important files that should not be deleted - you should mark as archived.
This is the standard version of ZM, but with a new sidebar. This sidebar is under development.
busymind
Posts: 38
Joined: Fri Jan 03, 2025 9:55 pm
Location: Montreal

Re: Filter -- limit the amount of deleted files issue

Post by busymind »

In term of compliance, nobody may archive videos (watching and archive them for some reason), if something happens on surveillance site (and later needed a proof) and space is almost full the owner will loose those videos.
What I trying to say the limit (as I had understand it) could be useful to delete only the first X number of files (videos), always keep a poll of videos for later retrieval, period which is of course depending of the size of the storage.
2025-04-11 12_57_46-Clipboard.png
2025-04-11 12_57_46-Clipboard.png (36.19 KiB) Viewed 720 times
Anyway thank you L.A.
IgorA100
Posts: 203
Joined: Sat Feb 03, 2024 11:55 am

Re: Filter -- limit the amount of deleted files issue

Post by IgorA100 »

My configured filter, the screenshot of which I published, deletes exactly the oldest events. That is, everything happens as in your picture.
Post Reply