mirror of
https://github.com/woodchen-ink/docker-firefox.git
synced 2025-07-18 05:42:00 +08:00
Make sure log files do not grow indefinitely.
This commit is contained in:
parent
bbf1a7c10e
commit
8221ae534c
@ -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 :
|
||||
|
Loading…
x
Reference in New Issue
Block a user