Automating partial backups

How can I automatically backup HA - but not backup my media folder each time.

You can call the service hassio.backup_partial selecting what you wanna backup.

By the way, I love the Google Drive Backup add-on and I use that to manage my backups.
You can select partial backups there as well, and uncheck your media folder:

2 Likes

Thanks, I knew there had to be a way.

However, I have yet to find any documentation describing the syntax to specify what to not backup so I don’t have to maintain the automation every time I add an add-on or whatever.

The google backup add-on is great but I have subscribed to dropbox for years and don’t want to have to rent google space too. My current dirty solution is that I use google backup to create the backup, only permit it to upload and keep one backup in the cloud but have ā€˜dropback’ add-on copy the backups it creates to dropbox.

You can also use this for a local solution, if you have some network attached storage.
Partial backups are supported too.

Most of these allow partial backups to not only be done automatically but copying the resultant backup elsewhere too: https://www.home-assistant.io/common-tasks/os/#copying-your-backups-to-another-location

So, the remaining issue is - how do I construct an automation which does a backup of everything excluding the media folder that does not require maintenance each time the add-on or folder items change over time?
Is there a way to get a list of the add-ons? the folder names? that i can then insert into the automation?
I need this because I use dropbox which noone has yet created a sophisticated backup add-on like the google drive backup.

1 Like

Do I understand it right, that Samba backup is not suitable option for you?
That one does does everything, you asked for… just not on dropbox, but on your own NAS, so your backups are stored locally, not in the cloud.

Correct, samba requires me to have another computer/nas running. I travel and the only things i leave running are the HA in two separate houses. Also if there was a disaster in my home I’d lose my backups as well as my HA.
So, I want cloud storage using Dropbox which I have subscribed to for my photos etc for years.

I know this is an old topic, but I had the same problem and couldn’t find a clear answer on the forums — maybe this helps someone

If you want to back up everything except the /media folder, you can use a partial backup.

This snippet automatically includes all installed add-ons (so you don’t have to maintain the list) and skips /media simply by not listing it under folders:.

  - action: hassio.backup_partial
    data:
      compressed: true
      homeassistant: true
      homeassistant_exclude_database: false
      name: Monthly_backup_{{ states('sensor.current_version') }}_{{ now().date() }}
      addons: |-
        {{ integration_entities('Supervisor')
          | select('match', 'update')
          | reject('match', 'update\.home_assistant')
          | map('device_attr', 'identifiers')
          | flatten
          | reject('eq', 'hassio')
          | list }}
      folders:
        - share
        - addons/local
        - ssl
1 Like

Somehow my ā€œnameā€ is not used by HA, and it just creates random backups like this: 85e8ecf2.tar

Do you see the random name in the UI as well, or only in the filesystem? Are you sure there isn’t a typo in the name key?

1 Like

This!
I’ve checked the UI of a backup`s page and found all names are there, so filenaming does not matter as long as HA show proper names in UI.