do not use -f to logrotate
Normally, logrotate is run as a daily cron job. It will not modify a log multiple times in one day unless the criterion for that log is based on the log's size and logrotate is being run multiple times each day, or unless the -f or --force option is used.
This commit is contained in:
@@ -40,7 +40,7 @@ for container in $containers; do
|
||||
logrotate_config=$(mktemp)
|
||||
{ echo "$logrotate_template" | LOG_VOLUME="$logdir" envsubst; } > "${logrotate_config}"
|
||||
|
||||
logrotate -f "${logrotate_config}"
|
||||
logrotate "${logrotate_config}" # -f is not required since we are size based
|
||||
|
||||
find "${logdir}" -mindepth 3 -maxdepth 3 -type d -exec rm -rf {} + # since we logrotate only till depth 3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user