Skip to content

How to Setup Automatic Sub Folder Creation

Claude Pageau edited this page Oct 15, 2020 · 4 revisions

Configure settings to auto create subfolders when specific condition is reached.

Introduction

config.py has settings for automatically creating subfolders based on time or maximum number of files in a subfolder. subfolders are created and named by date-time. This can be very useful when dealing with a long timelapse, motion track or video repeat sequence.

Automatically Create Subfolders

Edit config.py using menubox.sh SETTINGS menu.

cd ~/pi-timolo
./menubox.sh

or edit directly with nano

nano config.py

Select the section(s) (motion track, timelapse or video repeat) you want to have sub folders. Review the settings Below is a typical configuration that creates timelapse images based on maximum files in a subfolder.

TIMELAPSE_NUM_RECYCLE_ON = False # Default= True Restart Numbering at NumStart  False= Surpress Timelapse at NumMax
TIMELAPSE_NUM_START = 100000   # Default= 1000 Start of timelapse number sequence
TIMELAPSE_NUM_MAX = 0         # Default= 2000 Max number of timelapse images desired. 0=Continuous
TIMELAPSE_EXIT_SEC = 0        # Default= 0 seconds Surpress Timelapse after specified Seconds  0=Continuous
TIMELAPSE_MAX_FILES = 0       # Default= 0 off or specify MaxFiles to maintain then oldest are deleted  Default=0 (off)
TIMELAPSE_SUBDIR_MAX_FILES = 10000 # Default= 0 off or specify MaxFiles - Creates New dated sub-folder if MaxFiles exceeded
TIMELAPSE_SUBDIR_MAX_HOURS = 0 # Default= 0 off or specify MaxHours - Creates New dated sub-folder if MaxHours exceeded
TIMELAPSE_PANTILT_ON = False   # True= Move pantilt to next TIMELAPSE_PANTILT_STOPS position for

This will run a continuous timelapse sequence starting at the image number sequence at 100000. No Exist by max number or elapsed seconds is set. A new date/time named timelapse subfolder will be created when there are ten thousand files in the folder. You will need to ensure there is sufficient disk space (external storage drive is recommended)

There are similar settings for motion and video repeat.

Test Changes

To Test changes ensure verbose = True in config.py stop and restart pi-timolo.py using menubox.sh or from console using commands below.

cd ~/pi-timolo
./pi-timolo.sh stop
./pi-timolo.py

If everything runs OK and a subfolder is created then you can set VERBOSE_ON = False and restart pi-timolo as a background task. Note you may want to restart the image name number sequences by deleting data/.dat* files. When the number of files in a subfolder reaches the TIMELAPSE_SUBDIR_MAX_FILES setting then a new date/time stamped subfolder will be created. You may restart pi-timolo.py at any time without affecting the current subfolder since it will continue to be used until the trigger condition is reached (max files or max seconds).

Clone this wiki locally