aboutsummaryrefslogtreecommitdiff
path: root/lib/subcommands
diff options
context:
space:
mode:
Diffstat (limited to 'lib/subcommands')
-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[*]}"