Writing a basic cron job in Linux which really helped give a good understanding on how the astrisk syntax works.
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │ 7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
crontab -l
crontab -e
You may be asked on the first run which editor to use between Nano and a couple variations of vim.
I wanted a cron job to run spin up a docker container on my Raspberry Pi at 2pm(PST) Monday - Friday. This seemed like it worked so far, on the first day.
0 14 * * 1,2,3,4,5 docker run [docker image]