Automatic backup name

Hi everyone,

I tried to make an automatic backup. The only thing which doesn’t work is the name of the backup. Here my config:

- id: '1584961424173'
  alias: 'Service: make full backup'
  description: Creates a full backup on Sunday
  trigger:
  - at: 03:00:00
    platform: time
  condition:
  - condition: time
    weekday:
    - sun
  action:
  - data:
      name: "Backup {{ now().strftime('%Y-%m-%d') }"
    service: hassio.snapshot_full

The name of the backups is now “Backup {{ now().strftime('%Y-%m-%d') }”, so the variable isn’t resolved. How can I fix this? Tried to use “data_template” instead of “data” but this didn’t work.

Thanks for your help!

1 Like

You are missing a } on the end of your template.

Try "Backup {{ now().strftime('%Y-%m-%d') }}"

2 Likes

Also “data_template”, not data.

2 Likes

Aaaarrrrgh, did oversee this. Thanks a lot. Also data_template was necessary.

Hi, I’m trying to implement if, but the file name is still random
how did you make it working?

See my old automation.yaml. Worked fine on my Raspberry.

After that I moved to docker based Home Assistant (Synology Diskstation), so I have no hassio anymore. Therefore I have now a different solution for backup.

Hi,

this is what i do

alias: 'Service: make full backup'
description: Creates a full backup on Sunday
trigger:
  - at: '03:00:00'
    platform: time
condition:
  - condition: time
    weekday:
      - sun
action:
  - data_template:
      name: 'Backup {{ now().strftime(''%Y-%m-%d'') }}'
    service: hassio.snapshot_full
mode: single

but the file still has a random name

Please try my line: name: Backup {{ now().strftime('%Y-%m-%d') }}

2 Likes

I tired, but i still get this
image

Worked like a charm. Thanks!!

I’m lost. It’s my third iteration of code and still I can’t get this simple naming scheme to work. Anyone have any solutions for me?

- id: '1704525254258'
  alias: HAFullBackup at 3am
  description: ''
  trigger:
  - platform: time
    at: 03:00:00
  condition: []
  action:
  - service: hassio.backup_full
    data:
      compressed: true
      homeassistant_exclude_database: false
      name: "{{ now().strftime('%Y%m%d') }}_AutomatedFullBkup"

Anyone available to help here? :smiling_face:

You can only change the name of the backup inside the backup. This is shown when you see the list of backups in HA. This has unfortunately no impact on the filename of the backup.

1 Like