aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2022-10-17 12:45:47 +0200
committerPatrick Spek <p.spek@tyil.nl>2022-10-17 12:45:47 +0200
commit3fdeadf1f19f08995d610d0dc4cf7fb2893bd8f1 (patch)
tree38a456876ab1695ccebe3220295e9930f63e0eb0
parente6d0cd45e243fe735ecb54dc1da528057724dd88 (diff)
Update backup subcommand to use new config_subkeys semantics
-rw-r--r--lib/subcommands/backup.bash14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/subcommands/backup.bash b/lib/subcommands/backup.bash
index 9a23ede..0d3f22d 100644
--- a/lib/subcommands/backup.bash
+++ b/lib/subcommands/backup.bash
@@ -22,9 +22,9 @@ subcommand() {
then
debug "$BASHTARD_NAME/backup" "Retrieving elements from config"
- while read -r element
+ while read -r key
do
- set -- "$@" "$(config "$element")"
+ set -- "$@" "$(config "bashtard.backup.elements.$key")"
done < <(config_subkeys "bashtard.backup.elements")
fi
@@ -39,14 +39,12 @@ subcommand() {
# Loop over all repositories, and run backup functions for each of them
while read -r key
do
- index="$(awk -F. '{ print $NF }' <<< "$key")"
-
for element in "$@"
do
- "backup_$element" "$index"
+ "backup_$element" "$key"
done
- info "$BASHTARD_NAME/backup/$index" "Backups completed"
+ info "$BASHTARD_NAME/backup/$key" "Backups completed"
done < <(config_subkeys "bashtard.backup.repositories")
}
@@ -93,9 +91,9 @@ backup_filesystem() {
)
# Add all paths to the command
- while read -r path
+ while read -r key
do
- cmd_create+=("$(config "$path")")
+ cmd_create+=("$(config "bashtard.backup.fs.paths.$key")")
done < <(config_subkeys "bashtard.backup.fs.paths")
notice "$BASHTARD_NAME/backup/$index" "> ${cmd_create[*]}"