hassio-google-drive-backup icon indicating copy to clipboard operation
hassio-google-drive-backup copied to clipboard

[Feature request] Allow backups to multiple locations

Open Henk72 opened this issue 1 year ago • 4 comments

Network storage is now a new option of HA and now also enabled on this nice plugin.

It would be nice to save backups to network storage and allow to once in a while (parameter) store also a backup on Google drive. The latter is an extra safety in case a NAS would fail.

Henk72 avatar Jun 20 '23 06:06 Henk72

You could accomplish this by setting "Backups in Google Drive" to 1, it will just keep one backup on Drive. Or do you mean you'd only want to upload to Google Drive infrequently, ie once a week, but backup to NAS more often?

sabeechen avatar Jun 20 '23 07:06 sabeechen

Thank you for the last response Stephen!

Yes, I meant the latter, to update to the Drive infrequently.

Vielen dank!

On 20 Jun 2023, at 09:14, Stephen Beechen @.***> wrote:

You could accomplish this by setting "Backups in Google Drive" to 1, it will just keep one backup on Drive. Or do you mean you'd only want to upload to Google Drive infrequently, ie once a week, but backup to NAS more often?

— Reply to this email directly, view it on GitHub https://github.com/sabeechen/hassio-google-drive-backup/issues/874#issuecomment-1598238551, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADLWGBMKUZVA7XMRUTW3XN3XMFEU7ANCNFSM6AAAAAAZMZ5XZM. You are receiving this because you authored the thread.

Henk72 avatar Jun 20 '23 12:06 Henk72

Thats a little more complicated, but I still think doable. I try to keep the configuration options as simple as possible, or at least not any more complicated, in order to handle the typical use case well and keep things maintainable. For more complicated use cases like yours, my recommendation is to use Home Assistant to create backups and disable some of the functionality the addon turns on by default.

Lets say you want to backup once a week to Google Drive, and only keep two backups there. Lets say you also want to create a daily backup on your NAS, with a 7 day history. Then I'd set:

  • Set "Backups in Google Drive" to 2
  • Set "Days Between Backups" to 7
  • Check "Ignore other Backups" (this will prevent the addon from uploading any backups it didn't create to Google Drive)
  • Set "Delete ignored backups after" to 7 days. this will make the addon delete any backups it isn't uploading after a week.
  • Then create an automation in Home Assistant to create a backup once a day on your NAS. you'd probably use the automation ui to cerate it, but they yaml would look like:
    description: "Create a daily backup at 6am"
    mode: single
    trigger:
      - platform: time
        at: "06:00:00"
    condition: []
    action:
      - service: hassio.backup_full
        data:
          compressed: true
          name: Daily Backup {{ now().strftime('%Y-%m-%d') }}
          location: your_nas_name
    

With this config the addon won't upload the daily backup (because of the "ignored" setting) but it will delete them after 7 days, and the weekly backup will get uploaded to Google Drive.

sabeechen avatar Jun 20 '23 15:06 sabeechen

Wow, thank your Stephan for the elaborate explanation! I will try your suggestions!

Kind regards, Jos

Sent from my iPhone

Op 20 jun. 2023 om 17:09 heeft Stephen Beechen @.***> het volgende geschreven:



Thats a little more complicated, but I still think doable. I try to keep the configuration options as simple as possible, or at least not any more complicated, in order to handle the typical use case well and keep things maintainable. For more complicated use cases like yours, my recommendation is to use Home Assistant to create backups and disable some of the functionality the addon turns on by default.

Lets say you want to backup once a week to Google Drive, and only keep two backups there. Lets say you also want to create a daily backup on your NAS, with a 7 day history. Then I'd set:

  • Set "Backups in Google Drive" to 2
  • Set "Days Between Backups" to 7
  • Check "Ignore other Backups" (this will prevent the addon from uploading any backups it didn't create to Google Drive)
  • Set "Delete ignored backups after" to 7 days. this will make the addon delete any backups it isn't uploading after a week.
  • Then create an automation in Home Assistant to create a backup once a day on your NAS. you'd probably use the automation ui to cerate it, but they yaml would look like:

description: "Create a daily backup at 6am" mode: single trigger:

  • platform: time at: "06:00:00" condition: [] action:
  • service: hassio.backup_full data: compressed: true name: Daily Backup {{ now().strftime('%Y-%m-%d') }} location: your_nas_name

With this config the addon won't upload the daily backup (because of the "ignored" setting) but it will delete them after 7 days, and the weekly backup will get uploaded to Google Drive.

— Reply to this email directly, view it on GitHubhttps://github.com/sabeechen/hassio-google-drive-backup/issues/874#issuecomment-1598982350, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADLWGBNYZ2TDWOB6GZ3PIHLXMG4KTANCNFSM6AAAAAAZMZ5XZM. You are receiving this because you authored the thread.Message ID: @.***>

Henk72 avatar Jun 20 '23 15:06 Henk72