Hassio 0.61 Snapshot Service

No problem @hfyoung3 ! I’ve been on quite the journey. Kudos to @danielwelch for this excellent blog and @frenck for all the great dev tools!

The Remote Backup add-on are now released: automate your snapshots to a remote server by exploiting hassio cli and scp.

2 Likes

Great, thanks for this addon!
Can you add the possibility to support password protected snapshots?

That shouldn’t be too difficult. But I might not have any time to implement it before the weekend though.

Thanks! There is no hurry :grinning:

Implemented in v0.2.0

1 Like

I tried to do a partial backup that only include the home assistant config but it dose not seem to work.

- alias: Daily Backup of home assistant config
  trigger:
    platform: time
    at: '3:00:00'
  action:
  - service: hassio.snapshot_partial
    data_template:
      name: "config {{ now().strftime('%Y-%m-%d') }}"
      folders:
        - homeassistant

Hi there,

I have been using your automation for quite a while and it works flawlessly, many thanks for this!

Now the problem I run into is that my sd card runs full from time to time (obviously). At the moment I have an automation telling me when it is almost full and I manuall delete the snapshots > 4 weeks. Can you point me towards how to automate this? That would be great!

Thanks in advance and best regards!

Gunnar

I use a shell command to delete all of my snapshots over 30 days old:

shell_command:
  delete_old_snapshots: find /backup/* -mtime +30 -exec rm {} \;

Then my backup automation runs nightly:

- alias: Daily Backup at 11 PM
  id: daily_backup_and_cleaning
  trigger:
    platform: time
    at: '23:00:00'
  action:
    - service: hassio.snapshot_full
      data_template:
        name: Automated Backup {{ now().strftime('%Y-%m-%d') }}
    - service: notify.slack
      data_template:
        message: Creating backup named "Automated Backup {{ now().strftime('%Y-%m-%d') }}"
    - service: shell_command.delete_old_snapshots

Hope that helps. I would be curious how others handle this as well.

8 Likes

Nice. This is how I did something similar in python for the keep_last option in my Dropbox addon. Aside from not being bash, the main difference is that I delete via a service call to the hassio snapshot delete service. Works really nicely.

3 Likes

Would it be possible for you to add Google Drive support?

Feel free to check my progress so far, test it out, or even better, help! :slight_smile: I’ve mentioned before that I’ve run into difficulties with handling the authorization solely through the UI for google drive. I actually got the current implementation working once, but when I went back to test it on my raspberry pi, nothing was uploading. I haven’t gone back to the project since then.

I have switched over to use your Dropbox add-on and it works great. Thanks for the work!

@danielwelch

Is there an option in your Dropbox Sync add-on to turn on timestamps in logging?

Thanks again!

Dan

There isn’t, and there should be. I’ll add timestamps to the logging.

Has anyone figure out how to call service with password protection?

Yes, you can password protect backups by adding the "password" field to the service call or your automation.

automation:

  - alias: Daily Dropbox backup
    trigger:
      platform: time
      at: '2:00:00'
    action:
      - service: hassio.snapshot_full
        data_template:
          name: Automated Backup {{ now().strftime('%Y-%m-%d') }}
          password: YOUR PASSWORD
      - delay: '02:00:00'
      - service: hassio.addon_stdin
        data_template:
          addon: "7be23ff5_dropbox_sync"
          input: {"command":"upload"}

The Remote Backup addon stopped working for me and I’m now getting the following error on the supervisor:

18-10-07 15:51:08 INFO (SyncWorker_13) [hassio.docker.interface] Pull image fixated/remote-backup-armhf tag 0.3.0.                                                                                   
18-10-07 15:51:45 INFO (SyncWorker_13) [hassio.docker.interface] Tag image fixated/remote-backup-armhf with version 0.3.0 as latest                                                                  
18-10-07 15:52:26 INFO (SyncWorker_17) [hassio.docker.addon] Start Docker add-on fixated/remote-backup-armhf with version 0.3.0                                                                      
18-10-07 15:52:26 WARNING (MainThread) [hassio.api.security] /snapshots/new/full no role for ce20243c_remote_backup                                                                                  
18-10-07 15:52:26 ERROR (MainThread) [hassio.api.security] Invalid token for access /snapshots/new/full 

Any idea why I’m missing the API token now? This was working fine until a few days ago FYI. Thanks

Is there a way to specify the actual file name that is used, rather than just the name that Snapshot uses, and if so will/can it overwrite a previous file name (for example I want to name the actual backup file Backup_mon.tar and overwrite it every Monday ?

1 Like

I second that question - would be cool to have an opportunity to name “automatic” snapshots as for example: “auto_XXXX”, so other operations [like dropbox sync or/and deleting the oldones or something] could be done ONLY on those automatic ones. that way we could keep some “precious” snapshots untouched :slight_smile:

No way to do this that I know of during the snapshot creation process or through the Hassio API itself.