This is the content of /etc/cron.daily/docker-logrotate<br />
<br />
---<br />
#!/bin/sh<br />
<br />
LOGROTATE=true<br />
[ -f /etc/sysconfig/docker ] && source /etc/sysconfig/docker<br />
<br />
if [ $LOGROTATE == true ]; then<br />
for id in $(docker ps -q); do<br />
exec $(docker exec $id logrotate -s /var/log/logstatus /etc/logrotate.conf > /dev/null 2&>1)<br />
done<br />
fi<br />
exit 0<br />
---<br />
<br />
There's an error in the exec line. It should read like this:<br />
---<br />
exec $(docker exec $id logrotate -s /var/log/logstatus /etc/logrotate.conf > /dev/null 2>&1)<br />
---<br />
<br />
That error cause the rotation inside the docker containers to silently fail.
↧