Currently I’m saving images to a folder in “www” for when someone rings my door bell. What I would like to do is save the most resent image as “latest_doorbell_image” and rename the one that was saved before that as a different name. Just like the Deepstack intergration does. That way I can display the latest image in the UI.
Then I have a script that deletes anything older than 5 days: 'find /config/tensorflow/storagemotion/ -maxdepth 2 -type f -mtime +5 -exec rm {} -f \;'
The script runs once a day…
This is the full script.
This one liner searches (find) for files (-type f) in /config/tensorflow/storagemotion/ and subfolders up to 2 levels down (-maxdepth 2) that are older than 5 days (-mtime +5) and force deletes them (-exec rm {} -f \;)
Automation with alias ‘Security Balcony Camera Snapshot’ could not be validated and has been disabled: template value should be a string for dictionary value @ data[‘action’][0][‘data’]. Got [OrderedDict([(‘entity_id’, ‘camera.security_balcony’), (‘filename’, ‘/config/www/img/security/balcony/security_balcony_camera_last.jpg’)]), OrderedDict([(‘entity_id’, ‘camera.security_balcony’), (‘filename’, ‘/config/www/img/security/balcony/{{ now().strftime(“%Y%m%d_%H%M%S”) }}security_balcony_camera.jpg’)])]