The hosting panel allows you to create and add scheduled tasks, which will be performed automatically at certain intervals of time. If you worked with Linux-based systems, these are cron tasks.
For example, you can create a script to perform database backups and send them to you via FTP, or you can run a PHP file: to send a report at the end of the day.
To create a scheduled task, you need to go to the hosting control panel and open the "Advanced features" ➡️ "Cron Jobs" section. And click "Create cron task".
Setting up cron is simple:
- in the "Minute / Hour / Day of Month / Month / Day of Week" field, enter the required interval of the scrip execution;
There will be a question mark next to each of the parameters. When you hover over it, you will see in which format the values should be entered.
Only the fields that are required are filled in, the rest are left with an asterisk. For example, if you want the task to run every hour at the beginning of the hour, put 0 in the "Minute" field and an asterisk in all other fields — *.
- in the "Command" field enter your script.
- if you want to run a PHP file, type in the line "/usr/local/bin/php" and then the full path to the file.
Click on "Create" to add this cron job.
Eldar Polishchuk
Comments