Skip to content

How to Manage Disk Space

Claude Pageau edited this page Jan 18, 2018 · 7 revisions

Introduction

Disk space management is primarily designed for smaller size SD cards or for video files where file recycling is not used. Using this disk space management feature will avoid filling the storage device and causing Raspbian system problems due to lack of space. If you are saving to an external device with a large capacity then you may not want to use this feature. Also disk space checking will slow down motion tracking and timelapse functions.

config.py Disk Space Settings

Disk space management is controlled from the config.py file per the following 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 = '/home/pi/pi-timolo/media'  # default= '/home/pi/pi-timolo/media'  Starting point for directory walk
spaceFileExt  = 'jpg'

To turn on disk space management set spaceTimerHrs to number of hours to check disk space. If you just want to check disk space every day set spaceTimerHrs = 24. this will check once a day and delete the oldest spaceFileExt files in the spaceMediaDir folder tree until the required spaceFreeMB is reached. Only 25 percent of total files will be deleted in one session.

If you do not want files deleted you may wish to archive files to a local network share or rclone remote storage name using rclone.

Clone this wiki locally