]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
change create remotes backup pathes
authorBastian Dehn <hhaalo@arcor.de>
Wed, 5 Aug 2026 14:32:47 +0000 (16:32 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 5 Aug 2026 14:32:47 +0000 (16:32 +0200)
src/backup
tests/backup_tests.bats

index 0b0d2dd020d6fd5ba285ef9f2172caeee5fa7fc8..7433745d06fca61955c20c3343a9f814d26059ed 100755 (executable)
@@ -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
 }
 
index fc3094373d712d404a4f6ea2e596a82e450879dd..c220d4582f7365c5c79aa056d3aa53607274c3b6 100755 (executable)
@@ -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