backup_path=$(echo "$config" | jq --raw-output '.backup_path')
mapfile -t machines < <(echo "$config" \
| jq --raw-output '.machines | keys[]')
- local full_backup_path="$backup_path/$backup_dir"
+ local full_backup_path=
local machine=
for machine in "${machines[@]}"; do
- echo "ℹ️ INFO: create directory $full_backup_path/$machine"
+ full_backup_path="$backup_path/$backup_dir/$machine"
+ echo "ℹ️ INFO: create directory $full_backup_path"
+ mkdir --parents "$full_backup_path"
done
}
assert_line --index 7 "ℹ️ INFO: create directory build/2000-01-01_01_backup/testpc2"
assert_line --index 8 "✅ SUCCESS: backup"
[ -d "build/2000-01-01_01_backup" ]
+ [ -d "build/2000-01-01_01_backup/testpc1" ]
+ [ -d "build/2000-01-01_01_backup/testpc2" ]
}
\ No newline at end of file