Giter Club home page Giter Club logo

hassio-remote-backup's Introduction

Remote Backup

GitHub Release Build Status GitHub license

This is originally made by overkill32, but as it broke after HA update to 0.9x I've fixed it. Tested on 092.1, 092.2.

Automatically create Hass.io snapshots to remote server location using SCP.


Table of Contents

About

When the add-on is started the following happens:

  1. Snapshot are being created locally with a timestamp name, e.g. Automatic backup 2018-03-04 04:00.
  2. The snapshot are copied to the specified remote location using SCP.
  3. The local backup are removed locally again.

Note the filenames of the backup are given by their assigned slug.

Installation

  1. Add the add-ons repository to your Hass.io instance: https://github.com/pflaugh/hassio-addons.
  2. Install the Remote Backup add-on.
  3. Configure the add-on with your SSH credentials and desired output directory (see configuration below).

See my repository of addons for more information.

Configuration

Parameter Required Description
ssh_host Yes The hostname/url to the remote server.
ssh_port Yes The port to use to SCP on to the server.
ssh_user Yes Username to use for SCP.
ssh_key Yes The ssh key to use. Not that it should NOT be password protected.
remote_directory Yes The directory to put the backups on the remote server.
zip_password No If set then the backup will be contained in a password protected zip
keep_local_backup No Control how many local backups you want to preserve. Default ("") is to keep no local backups created from this addon. If all then all loocal backups will be preserved. A positive integer will determine how many of the latest backups will be preserved. Note this will delete other local backups created outside this addon.

Example: daily backups at 4 AM

Personally I've added the following automation to make a daily backup. It is password-protected and the last two weeks of snapshots are kept locally as well.

configuration.yaml

automations:
  - alias: Daily Backup at 4 AM
  trigger:
    platform: time
    at: '4:00:00'
  action:
  - service: hassio.addon_start
    data:
      addon: ce20243c_remote_backup

Add-on configuration:

{
  "ssh_host": "192.168.1.2",
  "ssh_port": 22,
  "ssh_user": "root",
  "ssh_key": [
"-----BEGIN RSA PRIVATE KEY-----",
"MIICXAIBAAKBgQDTkdD4ya/Qxz5xKaKojVIOVWjyeyEoEuAafAvYvppqmaBhyh4N",
"5av4i87y8tdGusdq7V0Zj0+js4jEdvJRDrXJBrp1neLfsjkF6t1XLfrA51Ll9SXF",
"...",
"X+6r/gTvUEQv1ufAuUE5wKcq9FsbnTa3FOF0PdQDWl0=",
"-----END RSA PRIVATE KEY-----"
  ],
  "remote_directory": "~/hassio-backups",
  "zip_password": "password_protect_it",
  "keep_local_backup": "14"
}

Note: This is just an example, don't copy and past it! Create your own!

Changelog & Releases

This repository keeps a change log. The format of the log is based on Keep a Changelog.

Releases are based on Semantic Versioning, and use the format of MAJOR.MINOR.PATCH. In a nutshell, the version will be incremented based on the following:

  • MAJOR: Incompatible or major changes.
  • MINOR: Backwards-compatible new features and enhancements.
  • PATCH: Backwards-compatible bugfixes and package updates.

Docker status

Docker Architecture Docker Version Docker Layers Docker Pulls

Docker Architecture Docker Version Docker Layers Docker Pulls

Docker Architecture Docker Version Docker Layers Docker Pulls

Docker Architecture Docker Version Docker Layers Docker Pulls

hassio-remote-backup's People

Contributors

jasonatepaint avatar pflaugh avatar

Watchers

James Cloos avatar

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.