Cronjobs
With a cronjob you can execute recurring commands at a certain time.
TIP
The output of your cronjob command will be sent by email to the address registered with us as webmaster.
Frequency (Schedule)
A schedule is defined in the unix-cron string format. Use the usual crontab notation here:
m h dom mon dow- m minute
- h hour
- dom day of month
- mon month
- dow day of week
Common examples:
| frequency (schedule) | crontab expression |
|---|---|
| every minute | * * * * * |
| every even minute | */2 * * * * |
| every 5 minutes | */5 * * * * |
| every quarter hour | */15 * * * * |
| every hour | 0 * * * * |
| every 3 hours | 0 */3 * * * |
| hour range | 0 9-17 * * * |
| hourly except office hours | 0 0-8,19-23 * * * |
| daily | 0 0 * * * |
| every night at 2AM | 0 2 * * * |
| every Sunday | 0 0 * * sun or 0 0 * * 0 |
| Wednesday through Friday | 0 0 * * 3-5 |
| Weekends only | 0 0 * * 6,0 |
| once a week on Sunday | 0 0 * * 0 |
| every month | 0 0 1 * * |
| quarterly on the first of the month at 6:30AM | 30 6 1 */3 * |
| every year | 0 0 1 1 * |
For more examples of execution frequency, see Wikipedia or Crontab Guru examples.
If you are not familiar with crontab notation, it is best to use an online crontab editor. Our recommendation: Cronitor crontab guru
Command
This is the full command or script to run. If your script contains a correct Shebang line and the script is executable (chmod u+x), you can enter it here without specifying the interpreter.
Always use the absolute path to your own script. For system commands (like PHP/Python/Bash interpreters) no absolute path is needed.
A few examples with identical effect:
# Execute script explicitly under PHP 8.2
php82 /var/www/web999/files/cron.php
# Execute script with the latest PHP version
php /var/www/web999/files/cron.php
# Specification of the interpreter is not necessary (Shebang-line in the script)
/var/www/web999/files/cron.php
# Your files directory is located in $PATH
cron.phpThis is how you pass GET parameters to a PHP script (don't forget to call the script with the -f parameter):
$ php -f /var/www/web999/files/cron.php cache=1Of course you can also pass conventional parameters to a script, here is an example for the old Typo3 scheduler:
$ php /var/www/web999/public_html/www/public/typo3/cli_dispatch.phpsh schedulerIf you want to call a script via a public URL (instead of calling it directly via PHP binary), use wget preferably, possibly with additional redirection of the normal output (STDOUT) to nirvana (/dev/null):
$ wget -q -O - http://www.example.com/cron.php > /dev/nullRecommended cronjob commands for task scheduling of popular CMS/frameworks:
Laravel
* * * cd /var/www/web999/public_html/www/current &&
php artisan schedule:run >> /dev/null 2>&1Wordpress
* * * * wget -q -O - https://<domain>/wp-cron.php >/dev/null 2>&1