Coder Social home page Coder Social logo

clean_up_snapshots's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.