CityHost.UA
Help and support

Adding a task to CRON

To add a CRON task (hereinafter simply CRON), go to the control panel of cp.cityhost.ua - Hosting 2.0 - Go to the settings of the desired hosting - CRON - Click the "+" button

 

 

You can create a CRON in two variations — a simple task and a complex task . The chosen variation of the task does not affect the final result of the CRON execution, only the form of creating the task will change.

 

Simple task - for beginners who want to run a task simply and quickly by selecting example commands from the list.

 

A complex task - for experienced users who want to create a task on their own, fully understanding the logic of the functionality.

 

How to add a simple task

 

1. Choose a command — curl , wget or php . What to choose, see the instructions in which you create CRON or check with the site developer.

 

2. Indicate the path to the script.

 

For the curl and wget option, a link to the script is indicated, for example https://cityhost.ua/cron/script.php

 

For the php option, the path to the script on the hosting from the root directory is indicated, for example www/cityhost.ua/cron/script.php

 

3. Choose the script launch frequency.

 

4. Create a task with the "Add" button. If necessary, remove the "do not send report to e-mail" check box if you want to monitor the script's launches and the result of its work.

 

 

How to add a complex task

 

Please note that the hard mode is intended for advanced users. In a complex variation of the task, you need:

 

1. Specify the command in full, complex combinations of commands are allowed, for example /opt/alt/php74/usr/bin/php -f /var/www/ch12345678/cityhost.ua/cron/script.php

 

2. Choose the frequency of the script launch, clearly specifying the timer formula, for example, every 6 hours on Sunday 0 */6 * * 0

 

3. Create a task with the "Add" button.

 

 

How to configure e-mail for reports

 

By enabling the sending of reports to e-mail in the CRON settings, you will receive a notification about each task launch and the result of the script execution, which can be analyzed, understanding whether the task is working as it should, or whether something needs to be adjusted. It is not recommended to enable report delivery on a permanent basis to avoid report spam.