Skip to content

Service to clean up your home assistant snapshots, so you don't manually have to.

Notifications You must be signed in to change notification settings

tmonck/clean_up_snapshots

Repository files navigation

Clean up snapshots

HACS Badge Code style

CI Latest Release

This Home Assistant extension exposes a service to automate the clean up of old backups.

Prerequisites

To be able to use this extension you must have the following integrations enabled and configured within your Home Assistant installation.

To manage the installation and upgrades easier it's recommended to use HACS.

Installation

You can either use the easy button Open your Home Assistant instance and open a repository inside the Home Assistant Community Store. or you can install manually with the steps below.

  1. Navigate to HACS Store
  2. Search for "Clean up snapshots service"
  3. Click on the service, and then on DOWNLOAD
  4. Restart Home Assistant

Configuration

Adding the Clean up snaphots service can be done via the user interface by using this My button:

Open your Home Assistant instance and start setting up a new integration.

If the above My button doesn't work, you can also perform the following steps manually:

  1. Browse to your Home Assistant instance.
  2. In the sidebar, select Settings.
  3. From the configuration menu, select Devices & Services
  4. In the bottom right, select the Add Integration button.
  5. From the list, search and select "Clean up snapshots service".
  6. Follow the instructions on screen to complete the setup.

configuration.yaml

Warning The setup via the configuration.yaml file is being deprecated and will be removed in a future release. Add the following to your configuration.yaml file. Adjust the value number snapshots you want to keep.

clean_up_snapshots_service:
  number_of_snapshots_to_keep: 3 # optional, default value is 0
  1. Restart Home Assistant (Settings > System > Restart)
  2. Look for the new clean_up_snapshots_service.clean_up service (Developer Tools > Services).

Use in automations

You can trigger this service in an automation similarly to the one below.

alias: Daily snapshot clean up
initial_state: 'on'
trigger:
  platform: time
  at: '03:00:00'
condition:
action:
  - service: clean_up_snapshots_service.clean_up
    # Data is optional if you have defined the number of snapshots to keep in the configuration.yaml.
    # data:
      # If this property is passed to the service it will be used regardless of what you have in the configuration.yaml
      # number_of_snapshots_to_keep: 7

About

Service to clean up your home assistant snapshots, so you don't manually have to.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Languages