A Sample Crontab File for Docker Servers

Here is a sample Crontab file I use for making sure a Ubuntu based Docker server is kept up to date and old docker files are deleted when not needed.

#+---------------- minute (0 - 59)
# |  +------------- hour (0 - 23)
# |  |  +---------- day of month (1 - 31)
# |  |  |  +------- month (1 - 12)
# |  |  |  |  +---- day of week (0 - 6) (Sunday=0 or 7)
# |  |  |  |  |
# *  *  *  *  *  [user] [path to command to be executed]
0 0 0 * * root apt-get update && apt-get upgrade -y
0 3 * * * root /usr/bin/docker system prune -f