Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backup name default not working #94336

Closed
Mask3007 opened this issue Jun 9, 2023 · 16 comments · Fixed by #94468
Closed

Backup name default not working #94336

Mask3007 opened this issue Jun 9, 2023 · 16 comments · Fixed by #94468

Comments

@Mask3007
Copy link
Contributor

Mask3007 commented Jun 9, 2023

The problem

According to the inbuild documentation. Leaving the backup name empty should result in the default "current date and time".

image

In the Backup Overview the Backup displays as cryptic "536b9622" not with the defaulted name. Not distracted by that... I downloaded the Backup and looked at its backup.json and it also does not have any name:

{ "version": 2, "slug": "536b9622", "name": "", "date": "2023-06-09T09:28:24.693196+00:00", "type": "full", "supervisor_version": "2023.06.1", "... hint ..." : "... removed several attributes for smaller issue overview...", "compressed": true, "crypto": "aes128" }

What version of Home Assistant Core has the issue?

core-2023.6.1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Backup

Link to integration documentation on our website

https://www.home-assistant.io/integrations/backup/

Diagnostics information

No response

Example YAML snippet

service: hassio.backup_full
data:
  compressed: true
  password: 123456Secr€t

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Jun 9, 2023

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (backup) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of backup can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign backup Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


backup documentation
backup source
(message by IssueLinks)

@Mask3007
Copy link
Contributor Author

Mask3007 commented Jun 9, 2023

Sorry if this is pointed to the wrong integration I think I missed that it is the build in functionality in supervisor?

https://www.home-assistant.io/common-tasks/os/#backups

@home-assistant
Copy link

home-assistant bot commented Jun 9, 2023

Hey there @home-assistant/supervisor, mind taking a look at this issue as it has been labeled with an integration (hassio) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of hassio can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign hassio Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


hassio documentation
hassio source
(message by IssueLinks)

@rananna
Copy link

rananna commented Jun 12, 2023

I am having the same issue, the default backup name is random hex

@ludeeus
Copy link
Member

ludeeus commented Jun 12, 2023

The default is blank ””

@rananna
Copy link

rananna commented Jun 12, 2023

Sorry, I meant if I leave the name as blank (default) , the backup name is generated a randem hex, not current date and time

@ludeeus
Copy link
Member

ludeeus commented Jun 12, 2023

No, see the first post, the name is "" ("name": "")

@rananna
Copy link

rananna commented Jun 12, 2023

Yes, Ok, but rhe result is still random hex, not current date and time

@ludeeus
Copy link
Member

ludeeus commented Jun 12, 2023

Again, no.
Maybe you are talking about file names. Those have always been hex. and is not controllable to ensure uniqueness.

@rananna
Copy link

rananna commented Jun 12, 2023

No, i am referiing to the name in the supervisor.
To get current date as the file name I need the following script:
service: hassio.backup_full
data:
compressed: true
name: "{{ now().strftime('%Y-%m-%d') }}"

With name: "", you get random hex generated.

@ludeeus
Copy link
Member

ludeeus commented Jun 12, 2023

In the UI? in the API? in the json file as shown in the initial post?
The UI falls back to showing the slug (hex) if the name is blank https://github.com/home-assistant/frontend/blob/dev/hassio/src/backups/hassio-backups.ts#L128 but even here, the name is "" and not hex.

@rananna
Copy link

rananna commented Jun 12, 2023

In system - backups in the ui

@Mask3007
Copy link
Contributor Author

Mask3007 commented Jun 12, 2023

Yeah but in the doc of hassio there is declared that if the name is blank hassio uses date and time.

That the slug is represented on empty name is not the problem. The problem is either that the doc is wrong, so the hassio integration is not generating any default name, or that the issue is that the hassio integration is not generating the name with date and time if none provided.

Take a look at the screenshot where it clearly stands that the default is date and time. This hint is provided by the integration.

@ludeeus
Copy link
Member

ludeeus commented Jun 12, 2023

Right, so the name is "".
Hassio (if you create it in that UI) will use date as the name.
The service call (which this issue is for) does not.

@rananna
Copy link

rananna commented Jun 12, 2023

The service call docs need to de changed then. It currently indicates that a blank name will result in a date and time name

@ludeeus
Copy link
Member

ludeeus commented Jun 12, 2023

Correct (which is why this issue is still open)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants