aboutsummaryrefslogtreecommitdiffstats
path: root/squashfu
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2025-09-09 02:50:52 +0200
committerLeonard Kugis <leonard@kug.is>2025-09-09 02:50:52 +0200
commit7c3c378266dfa4cef287313ba5be53be4c30c304 (patch)
tree25ee4b94450e222545e4ebba25c8a72ec10b7862 /squashfu
parent5c36e23afb99e262bdc35b9fb3537ef5664e39e8 (diff)
downloadsquashfu-master.tar.gz
Added option to truncate logs after backupHEADmaster
Diffstat (limited to 'squashfu')
-rwxr-xr-xsquashfu4
1 files changed, 4 insertions, 0 deletions
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