Fix hourly log rotation schedule

W/o this patch, new log rotation template for
Fuel 5.x master node with docker (which is
/etc/logrotate.d/20-fuel-docker.conf) would
never be scheduled for execution.
And that could have caused master node's /var/log/
free space exhausted until the next planned daily
log rotation will come.

DocImpact
Closes-bug: #1378327

Change-Id: I21ba3debcfda4d94d5e25786f97996f6431e5ec3
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
This commit is contained in:
Bogdan Dobrelya 2014-10-07 17:29:15 +02:00
parent 30285d6e12
commit d7497cfad5

View File

@ -4,7 +4,7 @@
# Due to bug existing, logrotate always returns 0. Use grep for detect errors: # Due to bug existing, logrotate always returns 0. Use grep for detect errors:
# would return 1 (considered as normal result), if logrotate returns no errors, return 0, if any. # would return 1 (considered as normal result), if logrotate returns no errors, return 0, if any.
#/usr/sbin/logrotate /etc/logrotate.d/20-fuel.conf >/dev/null 2>&1 #/usr/sbin/logrotate /etc/logrotate.d/20-fuel.conf >/dev/null 2>&1
nice ionice -c3 /usr/sbin/logrotate /etc/logrotate.d/20-fuel.conf >& /tmp/logrotate && grep -q error /tmp/logrotate nice ionice -c3 /usr/sbin/logrotate /etc/logrotate.d/20-fuel*.conf >& /tmp/logrotate && grep -q error /tmp/logrotate
EXITVALUE=$? EXITVALUE=$?
if [ $EXITVALUE != 1 ]; then if [ $EXITVALUE != 1 ]; then