Easy way to Purge / delete old recordings?

Is there an easy way to purge the DB and recorded files?

Back in ver 2.0 I use to be able to set the Disk space limit to like 1 or 2% and it would based on that purge out all the files / recordings until it reached that disk use %. I tried that in the 3.0, and did not appear to work.
I have 1TB drive set for the system. It had been using the global constant record.
I tried that trick and it did not seem to work. I install Webmin on it and used the file manager to purge out the recordings, Have my cameras set correctly for ONVIF trigger recording since all the cameras support that.
The system is now recording things. and have like 8 days of storage instead of like 2 hours.

Hello, I did manage to get the file / recordings to delete by decreasing the % disk space to like 1%. It takes a bit of time to delete out and open up the space. I assume when I shrink that disk use % to a very small value, it besides deleting the recordings it I assume is also removing the records from the DB? If anyone can explain what the DVR does when you say go from 80% disk use to say 2% disk use as to what all is being deleted and cleaned up due to the decrease in drive space allowed for recordings.
Chad

I don’t believe we remove the events from the database once files are deleted.

You could run truncate the EventsCam table and the system should realize there are events on the file system that do not exist in the database and remove them.

I can give you a command to truncate the EventsCam if you need.

That would be great, My SQL skills / commands are not good. I will appreciate that script / command.
I am sure I am a one off, but just encase others would want to purge files and keep the DB events cleaned up it might be useful for them as well.

Chad

Hello, Sorry it has been so busy, changing jobs and all. Where can I go get the script to run truncate the EventsCam table? Or am I miss reading it and that is the command to execute.

So if I ssh into the server as me, then sudo over to bluecherry user account and then just run the command “run truncate the EventsCam table” at the command line that will do the job?

Sorry for not fully understanding the process. How is the DVR user manual coming along. That might be a good place to make a footnote section on some command / processes that for the most part 99% of everyone would likely never use, but be nice to have documented for the rare few of us who do liek to do manual DB / recording cleanup and purge things out.

Chad

Hello,

Sorry it has been a long time since I wrote. Been Busy. I can’t remember if you sent a a command to truncate the EventsCam. I don’t remember an e-mail and do not see it with this post chain. COuld you please send the a command to truncate the EventsCam? Not sure if you want to post in in my question post or just e-mail it to me.
The only way I have discovered to prune out or free up space is to set the % disk space to like 5% or to what ever % I want it to shrink to. I assume that will also purge from database as well as delete the recordings, well I know it deletes the recordings, but just wanted to have a nice clean way to remove from DB and recordings.
Much Appreciated.

Sincerely,
Chad

You can run these commands, but be careful as this will delete all contents of events but will not delete the recorded files in /var/lib/bluecherry/ or any other storage path you use.

mysql -ubluecherry -p123 bluecherry -e "DELETE FROM EventsCam;"
mysql -ubluecherry -p123 bluecherry -e "ALTER TABLE EventsCam AUTO_INCREMENT=1;"

Thank you, that is great, and I know the location and will manually delete the recordings. Sometimes setting % storage to say 1% from like 90% seems to do the trick from time to time else I just go in and whack them manually myself. Seemed like last time I tried to reset to say 1% it seemed like it was not deleting them or cleaning up. Sometimes I can watch and see the free space increasing when I do that.

Much Appreciated.
Chad