From 000d7217e1acd1d26c1d1d3d93d481234e99d63a Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Wed, 5 Aug 2026 16:32:47 +0200 Subject: [PATCH] change create remotes backup pathes --- src/backup | 6 ++++-- tests/backup_tests.bats | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/backup b/src/backup index 0b0d2dd..7433745 100755 --- a/src/backup +++ b/src/backup @@ -132,11 +132,13 @@ backup_remotes() 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 } diff --git a/tests/backup_tests.bats b/tests/backup_tests.bats index fc30943..c220d45 100755 --- a/tests/backup_tests.bats +++ b/tests/backup_tests.bats @@ -277,4 +277,6 @@ teardown() { 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 -- 2.47.3