Feature request: Generate metadata
- Dominant language
- Perl
- Stars
- 2.1k
- Forks
- 139
- PR merge metrics
- No merged PRs in 30d
Description
Hi there. Btrbk is fantastic; after getting it set up and working with grub-btrfs it feels like such a great safety net and is such a better experience than other tools.
One thing I noticed, is that grub-btrfs parses metadata from Snapper and Timeshift that allows it to display snapshot info like a title/description. It does so with the following code:
```shell
# Parse Snapper & timeshift informations
local type_snapshot="N/A"
local description_snapshot="N/A"
if [[ -s "$grub_btrfs_mount_point/${path_snapshot%"/"*}/$snapper_info" ]] ; then
type_snapshot=$(awk -F"<|>" 'match($2, /^type/) {print $3}' "$grub_btrfs_mount_point/${path_snapshot%"/"*}/$snapper_info") # search matching string beginning "type"
description_snapshot=$(awk -F"<|>" 'match($2, /^description/) {print $3}' "$grub_btrfs_mount_point/${path_snapshot%"/"*}/$snapper_info") # search matching string beginning "description"
elif [[ -s "$grub_btrfs_mount_point/${path_snapshot%"/"*}/$timeshift_info" ]] ; then
type_snapshot=$(awk -F" : " 'match($1, /^[ \t]+"tags"/) {gsub(/"|,/,"");print $2}' "$grub_btrfs_mount_point/${path_snapshot%"/"*}/$timeshift_info") # search matching string beginning "tags"
description_snapshot=$(awk -F" : " 'match($1, /^[ \t]+"comments"/) {gsub(/"|,/,"");print $2}' "$grub_btrfs_mount_point/${path_snapshot%"/"*}/$timeshift_info") # search matching string beginning "comments"
fi
[[ -z "$type_snapshot" ]] && type_snapshot=("N/A")
[[ -z "$description_snapshot" ]] && description_snapshot=("N/A")
```
It seems like it would be trivial to add deeper support in grub-btrbk for btrbk, if you were interested in having functionality for btrbk to have a flag for manual runs which facilitated the input of user input, for instance?
I think it would be useful in case a user ran a manual backup, it would make their snapshots more easily identifiable.
Just a thought. Thanks again for producing this great bit of software.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.