llamafilm
(Elliott Balsley)
December 22, 2022, 6:47am
1
I’d like to make automated backups every night and upload them to S3 or some other durable location. Unfortunately the backup_partial
service generates a random name for each file, e.g. b1be9d49.tar
so there’s no way to pass that as a variable to the next step. I’d like an option to specify the filename. I’m also curious what the reasoning is for doing it this way? If we get this feature, I could use a script like this:
backup_to_s3:
sequence:
- variables:
backup_filename: hassio_backup{{ now().strftime('%Y%m%d_%H%M%S') }}
- service: hassio.backup_partial
data:
homeassistant: true
name: '{{backup_filename}}'
- service: minio.put
data:
bucket: my-s3-bucket
key: backups/{{backup_filename}}
enabled: false
mode: single
I found a few other threads where people were asking about the same thing:
hi,
when i execute backup and provide name of it…
[image]
the physical backup file inside /backup looks like
[image]
is there some purpose behind it? or why its not somehow named/tagged properly?
another issue via terminal there is missing YEar in ls -al
[core-ssh config]$ ls -acl /backup/
total 9730324
drwxr-xr-x 2 root root 4096 Mar 24 00:14 .
drwxr-xr-x 1 root root 4096 Mar 22 17:24 …
-rw-r–r-- 1 root root 15872000 Dec 2 20:08 1e40391a…
The documentation says if I leave blank “name”, the default will be current date and time, which is what I would like.
However, leaving name blank results in a backup with random hexadecimal characters.
Is this a bug?
How should I set an automation to make a backup with current date and time as name?
tom_l
December 22, 2022, 7:33am
2
Closing as a duplicate of:
I run an automated daily (nightly, actually) snapshot and the snapshots are automatically named “Automated Backup YYYY-MM-DD”. I keep deleting the ones that I don’t want to save for a longer period, but the ones that I keep for a while I would love to rename so that I can easily see which is which. AFAIK, there is no way to rename the snapshots, but I would love it if there was.
[image]
Please vote there.
Or here:
Would it be possible to have the snapshot name I choose in some capacity reflect on the actual filename of the snapshot instead of:
70344a3d.tar
Sometimes I need to find something in an old snapshot (backed up to NAS) and the name would make it much simpler.
I know there will be an issue with some characters and white spaces but perhaps that could be resolved somehow.
2 Likes