Setting CRON at Umbler
The software utility CRON is a time-based job scheduler in Unix-like computer operating systems. CRON is used to schedule jobs to run periodically at fixed times, dates, or intervals.
It is important to remark that at Umbler cronjobs can only be configured through the Control Panel.
Configuring a CRONJOB at Umbler is pretty easy, under the selected Domain go to Website > Settings > CRON.
To create a new cronjob go to create CRON.
Now, to create a new CRON, just fill in the fields:
- Name: A name for identification of the task.
- Execution interval: When the command should run. There are some preset time intervals, but you may also choose the Custom option and set the time interval manually. More details on how to customize the time interval will be shown below.
- Command: Inform the URL of the website to be executed. It will be executed by a cURL command.
- Receive execution notifications by e-mail: Choose whether you would like to receive notifications of the cron's execution result on your Umbler account e-mail.
After filling in all the fields click on Save and that's it! Your Cronjob is ready to go!
Customizing the time interval for the execution of the CRONjobs
There are some preset time intervals, but you may also choose the Custom option and set the time interval manually using the crontab syntax. In the Execution interval field choose the Custom option:
The syntax of each line expects a cron expression made of five fields:
[minute] [hour] [day of the month] [month] [day of the week]
- The asterisk (*): Represents all possible numbers for that position. For example, asterisk in the minute position would make it run every minute.
- Hyphen (-): Hyphens define ranges. For example, 2000–2010 indicates every year between 2000 and 2010, inclusive.
- Comma ( , ): Commas are used to separate items of a list. For example, using "MON,WED,FRI" in the 5th field (day of week) means Mondays, Wednesdays and Fridays.
- Slash (/): slashes can be combined with ranges to specify step values. For example, */5 in the minutes field indicates every 5 minutes.
Let's check out some examples:
- 5 0 * * *
5 Minutes after midnight, everyday (everyday of the month, every month).
- 15 14 1 * *
At 14h15min the first day of each month.
- 0 22 * * 1-5
At 22h on weekdays.
- 24 0-23/2 * * *
24 minutes after each hour of the day (0-23), but in a 2 hours interval (23/*2*). For example: at 00:24, 02:24, 04:24 and so on.
- 5 4 * * 7
At 04:05 every Sunday.