cron job not running inside docker container on ubuntu

Install rsyslog inside the container with apt-get install rsyslog and launch it with the command rsyslogd before starting cron with cron -L15 (maximum logging). Then watch the file /var/log/syslog inside the container to see the cron daemon’s own log output. It will tell you if there was a problem parsing your crontab and it will, in your case, log an entry every minute similar to the below if it has registered and is trying to run your job.

CRON[16]: (root) CMD (echo "Hello world" >> /var/log/cron.log 2>&1)

Leave a Comment