Automatically delete old camera snapshots

stefdewilde Is this right, when I run it nothing is deleted and there is nothing in the logs.
Works! I just didn’t wait long enough.

shell_command:
  removefrontdoorsnapshots: 'find /config/www/front_door_object_images/* -mtime 7 -exec rm {} \;'
  removedrivewaysnapshots: 'find /config/www/driveway_object_images/* -mtime 7 -exec rm {} \;'
  removebackyardsnapshots: 'find /config/www/backyard_object_images/* -mtime 7 -exec rm {} \;'
  removedecksnapshots: 'find /config/www/deck_object_images/* -mtime 7 -exec rm {} \;'
  removesideyardsnapshots: 'find /config/www/sideyard_object_images/* -mtime 7 -exec rm {} \;'
  removestreetsnapshots: 'find /config/www/sideyard_object_images/* -mtime 7 -exec rm {} \;'
  removehottubsnapshots: 'find /config/www/hot_tub_object_images/* -mtime 7 -exec rm {} \;'

automation:

- id: 7e2e07242bf24b8e9232f127cdec6646
  alias: Delete old Snapshots
  trigger:
    platform: time
    at: 02:05:00
  action:
  - service: shell_command.removefrontdoorsnapshots
  - delay:
      seconds: 30
  - service: shell_command.removedrivewaysnapshots
  - delay:
      seconds: 30
  - service: shell_command.removebackyardsnapshots
  - delay:
      seconds: 30
  - service: shell_command.removedecksnapshots
  - delay:
      seconds: 30
  - service: shell_command.removesideyardsnapshots
  - delay:
      seconds: 30
  - service: shell_command.removestreetsnapshots
  - delay:
      seconds: 30
  - service: shell_command.removehottubsnapshots 
1 Like