This post will guide you setup a crontab to run every year at 1 am from 1st to 9th of May and Jun
|day(s) of |
|month (s)||weekdays||application path|
Final command: * 1 1-9 5,6 * /cfg9/app.sh
Some special characters used in crontab
|,||Value list separator|
|–||Range of values|
What is cron & crontab
cron is a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals.
crontab is a UNIX command that creates a table or list of commands, each of which is to be executed by the operating system at a specified time.
Basic crontab command guide
This is some basic crontab commands you’ll use a lot.
|crontab -e||Edit your crontab file, or create one |
if it doesn’t already exist.
|crontab -l||Display/List your crontab file|
|crontab -r||Remove your crontab file|
|crontab -u username||Display/Modify crontab file |
belonging to a specific user if you are root
More detail on crontab command can be found with this command: