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!

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

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

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') }}

1 Like

I tired, but i still get this
image

Worked like a charm. Thanks!!