From 7c3c378266dfa4cef287313ba5be53be4c30c304 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Tue, 9 Sep 2025 02:50:52 +0200 Subject: Added option to truncate logs after backup --- squashfu | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'squashfu') diff --git a/squashfu b/squashfu index 48f5df7..3fff945 100755 --- a/squashfu +++ b/squashfu @@ -237,6 +237,10 @@ action_backup () { fi done + if ((${#TRUNCATE_LOGS[@]} != 0)); then + find "${TRUNCATE_LOGS[@]}" -type f \( -name "*.log" -o -name "*.log.*" \) ! -name "*.gz" -exec truncate -s 0 {} \; -o -name "*.gz" -exec rm -f {} \; + fi + check_for_resquash [[ val=$? -gt 0 ]] && create_new_squash $val -- cgit v1.2.3