Hetzner - DokuWiki

(Auto-update from VCS)
(Auto-update from VCS)
Zeile 42: Zeile 42:
<li><b>PHP5.3-CLI</b>: /usr/bin/php53</li>
<li><b>PHP5.3-CLI</b>: /usr/bin/php53</li>
<li><b>PHP5.6-CLI</b>: /usr/bin/php56</li>
<li><b>PHP5.6-CLI</b>: /usr/bin/php56</li>
<li><b>PHP7.0-CLI</b>: /usr/bin/php70</li>
<li><b>PHP7.1-CLI</b>: /usr/bin/php71</li>
<li><b>PHP7.1-CLI</b>: /usr/bin/php71</li>
<li><b>PHP7.2-CLI</b>: /usr/bin/php72</li>
<li><b>PHP7.2-CLI</b>: /usr/bin/php72</li>

Version vom 6. November 2019, 07:31 Uhr


Cron Job Manager

The Cron Job Manager makes it possible to automatically carry out particular scripts at regular intervals. You can create new cron jobs as well as change and delete existing cron jobs. If you wish the Cron Job Manager will send an email every time the 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 6 different fields: minutes, hours, days, months, weekdays as well as the command to be performed. The cron job data is reviewed every minute to see whether one of the cron jobs needs to be executed.

Development and execution of cron jobs

Before you create cron jobs, please note the following rules for their use:

  • A maximum of 10 cron jobs are allowed
  • The minimum time period between the execution of cron jobs is 2 hours
  • Cron jobs which require too many system resources will automatically be ended.

Click in the main menu under 'Add' to create a new cron job. If cron jobs already exist, click on 'Revise' to change them. On the following page you can:

  • Allocate a name for the cron job
  • Enter the instruction which you want carried out
  • Temporarily deactivate and reactivate the cron job
  • Specify the time period for which the cron job will run

A deactivated cron job continues to show up in the list of cron jobs, however, it will not be executed.

Please note: To select several values from the list for the timeframe, hold down the [Ctrl] key. At the bottom the selected values will be listed in the correct format.

Click on 'Save' to create or change the cron job.

Available Interpreter

Following interpreters are available:

  • PHP-CLI (newest PHP version): /usr/bin/php
  • PHP5.3-CLI: /usr/bin/php53
  • PHP5.6-CLI: /usr/bin/php56
  • PHP7.1-CLI: /usr/bin/php71
  • PHP7.2-CLI: /usr/bin/php72
  • PHP7.3-CLI: /usr/bin/php73
  • Bash: /bin/bash
  • Perl: /usr/local/bin/perl
  • Ruby: /usr/bin/ruby
  • Python: /usr/bin/python
  • Lynx (Browser): /usr/bin/lynx "https://your-domain.com/cron.php"

Script paths

Please always use absolute paths in cronjobs. On our servers you need to use:



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

Deleting a cron job

To delete one or more cron jobs, mark the boxes in front of the names of the cron jobs you wish to delete, and click 'Delete' in the menu. After a request for confirmation the selected cron jobs will be deleted.

Execution of a cron job

All existing cron jobs (including deactivated ones) can be manually executed with the Cron Job Manager. Click on 'Execute' next to the cron job you wish to run. After a confirmation request the selected cron job will be executed and the script output will be displayed.

Please note: Successful execution of cron jobs does not necessarily mean that the command was also successfully carried out. For example, the command may not be available or you have no access rights to it. In this case you will find an error message in the script output.

Email Notification

You are able to 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.

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.

Please note: If you create more than 10 cron jobs the surplus cron jobs will automatically be deactivated.

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.

© 2020. Hetzner Online GmbH. Alle Rechte vorbehalten.