The Cron Job Manager makes it possible to automatically carry out particular scripts at regular intervals. You can create new cron jobs and change and delete existing cron jobs. You can also use the Cron Job Manager to send yourself email notifications every time a cron job is executed.
What is a cron job?
A cron job is a scheduling service that runs a particular programme/script at particular times. Every cron job consists of either two (interval and the command you want to execute) or six (minutes, hours, days, months, weekdays and the command you want to execute). The cron job data is reviewed every minute to see whether one of the cron jobs needs to be executed.
Overview
You can have the results of your executed cron jobs sent to an email address. In this way, you can monitor whether the cron job was run successfully or not.
Below you see a list of all existing cron jobs including the following information:
- Is the cron job active?
- Is the cron job executed exclusively?
- Which command is executed?
For each cron job you have the following options:
Activate/Deactivate
To activate/deactivate a cron job, click on the cross/tick icon next to the cron job you wish to activate/deactivate and confirm that you want to activate/deactivate it. A deactivated cron job will still show up in the list of cron jobs, but it will not be executed.
Edit
See Creating/editing of cron jobs.
Delete
To delete a cron job, click on the trash-bin icon next to the cron job you wish to delete and confirm that you want to delete it.
Execute
All existing cron jobs (including deactivated ones) can be manually executed with the Cron Job Manager. Click on the play icon next to the cron job you wish to run. Confirm that you want to run the cron job. Then it will be executed, and the script output will be displayed.
Please note: Successful execution of cron jobs does not necessarily mean the command was also successfully carried out. For example, the command may not be available, or you might have no access rights to it. In this case, you will find an error message in the script output.
Creating/editing of cron jobs
Before you create cron jobs, carefully read the following rules:
- Minimum time period between executions: one minute. All cron jobs that have a time period of less than two hours between executions must be executed exclusively, meaning only one instance of the cron job can run at a time.
- Cron jobs which require too many system resources will automatically be ended.
- The cron script must be executable and have at least 705 rights or must be started over an interpreter.
- The path to the script must be absolute, i.e. including /usr/home/
/... - we recommend that you store the cron script outside the public_html.
Click in the main menu under 'Add' to create a new cron job. If cron jobs already exist, click on the pencil symbol in the overview to edit them. On the following page, you can:
- choose an interpreter for your command (see Interpreter)
- Enter the command you want to execute
- Specify the time period for which the cron job will run (see Runtime)
Click on 'Save' to finish creating or editing the cron job.
Interpreter
The following interpreters are available:
PHP interpreters:
- Version set in konsoleH:
/usr/bin/php
- PHP 5.6:
/usr/bin/php56
- PHP 7.2:
/usr/bin/php72
- PHP 7.3:
/usr/bin/php73
- PHP 7.4:
/usr/bin/php74
- PHP 8.0:
/usr/bin/php80
- PHP 8.1:
/usr/bin/php81
Other interpreters:
- Bash:
/bin/bash
- Perl:
/usr/local/bin/perl
- Ruby:
/usr/bin/ruby
- Python:
/usr/bin/python
- Lynx:
/usr/bin/lynx -dump
- Wget:
/usr/bin/wget
- cURL:
/usr/bin/curl
Script paths
Please always use absolute paths in cronjobs. On our servers, you need to use:
/usr/home/<ftplogin>/...
Example
In this example, your FTP user name (=login) is "user1", and your PHP script is in the directory public_html/cron/script.php
The call for the cronjob would be:
/usr/bin/php /usr/home/user1/public_html/cron/script.php
Runtime
You have three options for how to set the cronjob's runtime. At the bottom of the page, next to "Summary", you can see a summary of your settings.
1. Interval
With this option, you can choose from a selection of intervals. They are fixed, though. You can only choose them in exactly that form; you can't edit them.
2. Freetext
With this option, you have to specify every value yourself. Therefore, we recommend it only for experienced users. Here are some instructions:
You must enter data in the following format: minutes hours days months weekdays
Each unit must be valid in itself. Remember to separate each unit from the other ones with a space. Warning: The system will not save invalid input.
- Allowed operators:
- *: every minute/hour/day/...
- ,: multiple values - Example: 1,5 (every 1st and 5th minute/hour/day/...)
- -: from ... until ... - Example: 1-10 (the first 10 minutes/hours/days/...)
- /: in intervals - Example: */2 (every 2 minutes/hours/days/...)
- Allowed values for minutes: 00 - 59
- Allowed values for hours: 00 - 23 (00 = midnight, 12 = noon)
- Allowed values for days: 01 - 31
- Allowed values for months: 01 - 12/JAN - DEC (English shortcuts)
- Allowed values for weekdays: 00 - 06/SUN - SAT (English shortcuts)
- Allowed special commands (These stand on their own; you do not need to enter all the other values here):
- @hourly: hourly
- @daily/@midnight: daily
- @weekly: weekly
- @monthly: monthly
- @annually/@yearly: yearly
- @reboot: at every server reboot
3. Manually
With this option, you can select values by clicking on them. Here are your options:
- Single values
- Multiple values (Hold down the [Ctrl] key while making your selection)
- From ... until ... (Hold down the [Ctrl] key while making your selection and choose multiple values next to each other./Select more than one value by clicking the mouse button.)
As of now, intervals (values with /) cannot be chosen by clicking on them — except for the default options.
Extended view
In the extended view you can directly edit the content of your cron job files (crontab). Click on 'Save' to save your changes.
Cron job log file
You can look at all the notices that have to do with your cron jobs (execution, changes, etc.) in a log file. Click on 'Display Log File' in the main screen.