Answer the question
In order to leave comments, you need to log in
How to set up a cron task on Plesk?
Worked all day to set up cron job on Plesk.
To test a cron task, I used this method and created two documents: my_cron.php and an empty my_cron.txt
Code my_cron.php
<?php
$fd = fopen("my_cron.txt","a");
fwrite($fd, "Обращение к файлу - ".date("d.m.Y H:i")."\r\n");
fclose($fd);
?>
2 * * * * wget -q -O /dev/null "http://site.com/testcron/my_cron.php"
Answer the question
In order to leave comments, you need to log in
First of all, it is worth checking the cron task execution log (according to the standard, in /var/log/cron.log).
In general, we advise you to try changing the handler and specify the full path to wget (by the /usr/bin/wget standard). Also try to change handler and check script execution with php 2 * * * * /usr/bin/php /path/to/site/testcron/my_cron.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question