From ec895a4f317db3439b365b2595361f8122c19135 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Wed, 14 Oct 2015 15:10:51 -0700 Subject: [PATCH] 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. --- setup/container/docker_janitor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/container/docker_janitor b/setup/container/docker_janitor index 4f7ef8d35..285a9e09e 100755 --- a/setup/container/docker_janitor +++ b/setup/container/docker_janitor @@ -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