Preferred way to clean up full disk?

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
JimS
Posts: 37
Joined: Sun Feb 18, 2007 3:16 pm

Preferred way to clean up full disk?

Post 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
JimS
Posts: 37
Joined: Sun Feb 18, 2007 3:16 pm

Re: Preferred way to clean up full disk?

Post 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.
mikb
Posts: 604
Joined: Mon Mar 25, 2013 12:34 pm

Re: Preferred way to clean up full disk?

Post 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.
CharlotteFilemdar
Posts: 6
Joined: Thu Nov 23, 2023 8:09 am

Re: Preferred way to clean up full disk?

Post 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.
Post Reply