Quantcast
Viewing all articles
Browse latest Browse all 19115

0008511: docker-logrotate not working, wrong redirection

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.

Viewing all articles
Browse latest Browse all 19115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>