From ac1f7b782d3b22cf31581a645b33467b1ac44d51 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 17 May 2026 19:04:21 +0200 Subject: [PATCH] fix no stat for history file not exist --- backup | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 \ -- 2.47.3