Make sure log files do not grow indefinitely.

This commit is contained in:
Jocelyn Le Sage 2022-12-09 14:09:00 -05:00
parent bbf1a7c10e
commit 8221ae534c

View File

@ -62,10 +62,15 @@ if [ -n "$(ls /config/profile/sessionstore-backups/*.jsonlz4 2>/dev/null)" ]; th
done
fi
# Make sure monitored log files exist.
for LOG_FILE in /config/log/firefox/error.log
# Initialize log files.
for LOG_FILE in /config/log/firefox/output.log /config/log/firefox/error.log
do
touch "$LOG_FILE"
# Make sure the file doesn't grow indefinitely.
if [ "$(stat -c %s "$LOG_FILE")" -gt 1048576 ]; then
echo > "$LOG_FILE"
fi
done
# vim: set ft=sh :