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:
Girish Ramakrishnan
2015-10-14 15:10:51 -07:00
parent 3fc0a96bb0
commit ec895a4f31

View File

@@ -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