From: Bastian Dehn Date: Sun, 17 May 2026 17:04:21 +0000 (+0200) Subject: fix no stat for history file not exist X-Git-Tag: v1.0.0^2^2~4 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=ac1f7b782d3b22cf31581a645b33467b1ac44d51;p=simple-backup.git fix no stat for history file not exist --- diff --git a/backup b/backup index 6656344..6380481 100755 --- a/backup +++ b/backup @@ -37,8 +37,9 @@ rotate_history() { local history_file="$1" - [ -f "$history_file" ] \ - && history_lines=$(cat $history_file | wc -l) + [ -f "$history_file" ] || return 0 + + history_lines=$(cat $history_file | wc -l) echo "ℹ️ INFO: $history_file has $history_lines lines" [ $history_lines -ge 100 ] \ && savelog -c 10 -l $history_file \