Hetzner - DokuWiki

KonsoleH:Cronjob-Manager/en

Inhaltsverzeichnis

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.4-CLI: /usr/bin/php54
  • PHP5.5-CLI: /usr/bin/php55
  • PHP5.6-CLI: /usr/bin/php56
  • PHP7.0-CLI: /usr/bin/php70
  • PHP4: /home/httpd/cgi-bin/php-fcgi-starter.fcgi
  • PHP5.2: /home/httpd/cgi-bin/php5-fcgi-starter.fcgi
  • PHP5.3: /home/httpd/cgi-bin/php53-fcgi-starter.fcgi
  • PHP5.4: /home/httpd/cgi-bin/php54-fcgi-starter.fcgi
  • PHP5.5: /home/httpd/cgi-bin/php55-fcgi-starter.fcgi
  • PHP5.6: /home/httpd/cgi-bin/php56-fcgi-starter.fcgi
  • PHP7.0: /home/httpd/cgi-bin/php70-fcgi-starter.fcgi
  • PHP7.1: /home/httpd/cgi-bin/php71-fcgi-starter.fcgi
  • Bash: /bin/bash
  • Perl: /usr/local/bin/perl
  • Ruby: /usr/bin/ruby
  • Python: /usr/bin/python

Script paths

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

/usr/home/<ftplogin>/...

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:

/home/httpd/cgi-bin/php55-fcgi-starter.fcgi /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.



© 2018. Hetzner Online GmbH. Alle Rechte vorbehalten.