Skip to content

Instantly share code, notes, and snippets.

@harduino
harduino / docker-cron-example.md
Created March 31, 2020 08:15 — forked from jdeathe/docker-cron-example.md
How to install/run Cron in a Docker Container

How to install/run Cron in a Docker Container

Example crontab entry for testing

  • Append a timestamp to the log file every minute /var/log/cron.
  • Append "tick" and "tock" in alternate minutes to /var/log/cron.
* * * * * /bin/date --rfc-3339=seconds >> /var/log/cron
*/2 * * * * /bin/echo 'tick' >> /var/log/cron