fiaasco / borgbackup

Borg backup role
MIT License
16 stars 19 forks source link

Custom label when backing up #24

Open noplanman opened 4 years ago

noplanman commented 4 years ago

Would be a nice if borg-backup backup would allow for an extra parameter as a label for the backup, to make it easier to identify in the list.

I find it useful to set snapshots that have meaning, like before some bigger changes or when changing certain configs.

e.g. borg-backup backup "before installing xyz"

What do you think?

stroobl commented 4 years ago

It's an interesting idea, but how would you implement this?

noplanman commented 4 years ago

Quite easy actually. Since my changes to the backup command would allow the server to be the 2nd parameter, this label could be the 3rd, like so: borg-backup backup my-server "my label"

This would basically just add that text to the backup archive: ...borg create ... $REPOSITORY::$DATE-$3

We'd probably have to sanitize the entry to allow only alpha + num + dashes + underscores or something.

Other option would be to introduce proper parameters, like --label="my label", which is more future proof but adds it's own complexity.