From: Bastian Dehn Date: Sun, 9 Aug 2026 09:32:16 +0000 (+0200) Subject: add log entry for created backup X-Git-Tag: v1.0.6^2~1^2~22 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=1c72512c8ed93baf5323380b41c3b5d9cb49d2dc;p=simple-backup.git add log entry for created backup --- diff --git a/src/backup b/src/backup index 259d376..d69bd44 100755 --- a/src/backup +++ b/src/backup @@ -281,6 +281,8 @@ backup_machines() "$last_backup_dir_path" \ || return $? done + + log "$config" "created $backup_dir" } get_backup_count() diff --git a/tests/backup_tests.bats b/tests/backup_tests.bats index fdd3f1c..ac6eb49 100755 --- a/tests/backup_tests.bats +++ b/tests/backup_tests.bats @@ -397,9 +397,10 @@ teardown() { assert_line --index 7 "ℹ️ INFO: create directory build/test/2000-01-01_01_backup/testpc1" assert_line --index 8 "ℹ️ INFO: create directory build/test/2000-01-01_01_backup/testpc2" assert_line --index 9 "ℹ️ INFO: create directory build/test/2000-01-01_01_backup/onlylocal" - assert_line --index 10 "ℹ️ INFO: backup count: 1" - assert_line --index 11 "🏁 FINISH: backup run" - assert_line --index 12 "✅ SUCCESS: backup" + assert_line --index 10 "ℹ️ INFO: 2000-01-01 [none] created 2000-01-01_01_backup -> build/test/backup.log" + assert_line --index 11 "ℹ️ INFO: backup count: 1" + assert_line --index 12 "🏁 FINISH: backup run" + assert_line --index 13 "✅ SUCCESS: backup" [ -d "build/test/2000-01-01_01_backup" ] [ -d "build/test/2000-01-01_01_backup/testpc1" ] [ -d "build/test/2000-01-01_01_backup/testpc2" ] @@ -438,9 +439,10 @@ teardown() { assert_line --index 19 "################################################################################" assert_line --index 20 "ℹ️ INFO: machine ${LIGHTPURPLE}onlylocal${RESET}; path ${YELLOW}/home/local${RESET}" assert_line --index 21 "################################################################################" - assert_line --index 22 "ℹ️ INFO: backup count: 1" - assert_line --index 23 "🏁 FINISH: backup run" - assert_line --index 24 "✅ SUCCESS: backup" + assert_line --index 22 "ℹ️ INFO: 2000-01-01 [none] created 2000-01-01_01_backup -> build/test/backup.log" + assert_line --index 23 "ℹ️ INFO: backup count: 1" + assert_line --index 24 "🏁 FINISH: backup run" + assert_line --index 25 "✅ SUCCESS: backup" } # bats test_tags=backup:info