What are Cron Jobs?
A Cron Job is a Linux command that allows you to periodically run a script in your website.
They are usually used to periodically execute scripts related to email, databases or routine checks. For example, we could create a Cron Job that sends us by email a file from our website and another that makes a visit to an specific website. In MrDomain, you can configure your own Cron Job from “Advanced”, in your MrDomain management area, clicking on “Create Cron Job” and filling all the gaps that will appear below.
How to creat a Cron Jon in MrDomain?
They will only be able to make queries (GET HTTP) on a file hosted in the hosting plan. That query may later be reviewed from the “Last accesses” LOGS, in the “Subdomains” section of your MrDomain management area.
As an example, you can see a simple Cron Job in the screenshot above, it makes a GET HTTP query every hour in the next file: “http://www.eldominioquequiero.com/script.php”.
The syntax of each line expects a cron expression made of a quick configuration, a section for comments, an advanced section and five fields which represent the time to execute the command.
- Quick configuration: I you don’t want to create a custom configuration, you can use one of the examples you will find in this section.
- Minute: The minute when the command will be executed, ranges from 0 to 59.
- Hour: It sets the time when the command will be executed, ranges from 0 to 23.
- Day of the month: It indicates on which day of the month you want it to run, ranges from 1 to 31.
- Month: In this section you will be able to select the month when you want to execute the command, ranges from 1 to 12.
- Day of the week: This section will determine on which day of the week the command will be executed, ranges from 0 to 7.
- Comment: You can write a short comment in order to know the reason of the Cron Job.
- Advanced configuration (HTTP User y Password): Allows you to create a username and a password for the selected Cron Job. The explained syntax uses asterisks (*), that means “all” and each one of them represented temporary value (minute, hour, week…).