A cronjob is essentially a Unix command that executes a script or program on a specific time or date. Cronjobs are mostly used for retrieving email, sending email and update checks.
You can easily create cronjobs using the web hosting packages of TransIP. Although this does not work based on Unix commands, you can use these cronjobs to periodically execute PHP scripts and programs.
This article shows you how to configure cronjobs in your control panel using a web hosting package.
Inside your control panel, head to the tab 'Domains & Hosting' and select your domain name on the left hand side. Click the cog wheel next to 'Your website' and click on 'Cronjobs'.
Here you will find an overview of your created cronjobs. To create a new cronjob, click the button '+ Create cronjob'.
When creating a cronjob, you need to fill in the following information:
- The name of the cronjob
- The frequency of the cronjob
- The URL where the script is located
Optionally, you can choose to receive the output of the cronjob via email. In that case, check the box next to 'Email cronjob output' and enter the email address below.
When configuring a cronjob, you can choose when and how many times the cronjob needs to be executed. You can choose 5 variables: minutes, hours, days, months and weekdays.
Accepted values for the variables are shown in the image below.
You can choose sets of default frequencies in the drop down menu. When you choose 'Custom' you will be able to set a custom frequency:
- One moment: For example, enter a 2 in the field for 'Hours' to execute the cronjob at 2 PM.
- One timeframe: For example, enter 9-17 in the 'Hours' field to execute the cronjob in office hours.
- Always: By entering a * in each field, the cronjob will be executed every minute.
- To configure a cronjob for a Sunday, you can use both 0 and 7 in the 'Weekday' field.
- There are many different ways to configure a frequency. Select a few frequencies from the drop down menu to see what the possibilities are.
Click on 'Create cronjob' to activate your cronjob.
In this article we showed how to create a cronjob.
If you have any questions regarding this article, please send a message to our support team. You can reach them using the 'Contact us' button below.
If you wish to discuss this article with other users, feel free to leave a comment below.