Page 1 of 1

Preferred way to clean up full disk?

Posted: Tue Nov 21, 2023 12:43 pm
by JimS
Added a couple cameras and inadvertently had them recording full time and filled up my disk so ZM web page wasn't working but machine was still running and I could log in remotely (Ubuntu headless). So I couldn't run the filters that could usually be run to reduce disk space. I went into the numbered directories for each of the two cameras and issued:
sudo rm -r *
which freed up 50Gb
I can now use zmaudit to clean up the data base.

Wondering if there is a better way to do this while still keeping it fairly simple.
I found this - a script to do it and not delete archived events (don't have any but seems like a good thing). But it appears from the comments on the page it needs some adjustment for more recent versions and I didn't find that on the github site.
https://www.claudiokuenzler.com/blog/81 ... der-events

Re: Preferred way to clean up full disk?

Posted: Tue Nov 21, 2023 2:17 pm
by JimS
I ran zmaudit (with sudo) and it reported cleaning up some things. But in the zoneminder page it still shows events for the deleted recordings. No linked recordings but the events are listed. I expected zmaudit to delete the event listing. What am I missing? I stopped ZM, ran zmaudit, then restarted ZM.

Re: Preferred way to clean up full disk?

Posted: Tue Nov 21, 2023 6:16 pm
by mikb
It may take ZM audit a while to catchup if you deleted a LOT of items on disk and have it configured to only do X amount of work per run. Leave it another day and look again, see if the event count has come down over time.

Re: Preferred way to clean up full disk?

Posted: Wed Jan 03, 2024 10:19 am
by CharlotteFilemdar
Understandable dilemma! While rm -r * works in a pinch, there are definitely safer and less drastic options:
Configure ZM to automatically rotate and archive older recordings to a separate storage (external HDD, NAS) while keeping crucial recent footage on the main disk. If you feel comfortable with scripting, consider a dedicated tool like the one you found. Just ensure it's compatible with your ZM version and customize it as needed for specific retention rules.
Remember, rm -r * should be a last resort. Always have backups or clear retention policies before deleting recordings.