Closed johncohn closed 3 years ago
Speed Camera has space management feature. See config.py settings per default sample below
# Optional Manage Free Disk Space Settings
# ----------------------------------------
spaceTimerHrs = 0 # Default= 0 0=off or specify hours frequency to perform free disk space check
spaceFreeMB = 500 # Default= 500 Target Free space in MB Required.
spaceMediaDir = 'media/images' # Default= 'media/images' Starting point for directory walk
spaceFileExt = 'jpg' # Default= 'jpg' File extension to Delete Oldest Files
Set spaceTimerHrs variable to hours between space checks eg 82 hours. Do not set frequency too low since it can affect speed camera performance. Also I would set to an hour value that would put it in the night time (based on start of speed-cam.py) Note my example would normally run check at night if started during mid to late day
Set the required free space in megabytes or leave default value The rest should be OK for defaults. Note this does not update the sql database entry for the deleted items.
This has been tested but not extensively since I run my Speed Camera's from attached TB size SSD, SATA USB hard drives.
Let me know if this answers your question.
is there a good way to get speed cam to periodically clean up old images and other artifacts ? I'm finding that every week or so my pi crashes because the sd card is full.. I seems to be old image files taking up most of the space. It would seem that everyone would eventually have this problem. Is there any easy fix ? Eg.. do I need to set up a cron job to periodically clean out the images ?