• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

After update to Plesk 12.0.18 Scheduled Task not running

SuperElf

New Pleskian
Hello,

I recently updated from 11.5 to 12. After the update, my simple "Websites & Domains->Scheduled Tasks" is no longer executing.

I verified that the task is still present in Plesk and enabled.
The simple task launches one of my PHP web pages to perform an action:
(set to once a day: Min=30, H=7, DM=*, M=*, DW=*)
wget --quiet --delete-after "http://www.MYWEBSITE.com/some/path/index.php?someparam=somevalue"

This cron job had been working fine for more than a year but stopped working after the update.

Any suggestions would be greatly appreciated.

Thanks!
 
Hi Igor,

It seems that wget can no longer work from the ""Websites & Domains->Scheduled Tasks" after upgrading from Plesk 11.5 to 12.

Here are some interesting findings:

FACTS ABOUT WGET:
# which wget
/usr/bin/wget
# ls -l /usr/bin/wget
-rwxr-xr-x 1 root root 357400 Feb 10 2014 /usr/bin/wget

TRY ACCESING WITH FULL PATH (redirect output to a "test.txt" file)
from the cron log file:
Sep 23 20:05:01 server1 CROND[4462]: (someuser) CMD (/usr/bin/wget --quiet "http://www.WEBSITE.com/xyz" >test.txt 2>&1)
contents of test.txt file:
# cat /var/www/vhosts/WEBSITE.com/test.txt
-: /usr/bin/wget: No such file or directory

TRY ACCESING WITHOUT PATH (redirect output to a "test.txt" file)
from the cron log file:
Sep 23 20:10:02 server1 CROND[4496]: (someuser) CMD (wget --quiet "http://www.WEBSITE.com/xyz" >test.txt 2>&1)
contents of test.txt file:
# cat /var/www/vhosts/WEBSITE.com/test.txt
-: wget: command not found

It used to work fine every day before updating to Plesk 12.

Any assistance is greatly appreciated!
Thanks!
 
Here is another finding:

Scheduling the cron job under "Websites & Domains->Scheduled Tasks" no longer works after upgrading to Plesk 12.
BUT, copy/paste the same task into Server Management "Tools & Settings->Scheduled Tasks" did work (using a non-root user).

I *can* use this as a work around because I am currently the only user of this server. However, I would prefer to fix the root cause so that it can be done properly. Also, if I am seeing this problem, other folks are probably also seeing this problem. So if we can fix the root problem here on this forum, others may benefit.

Thanks!
 
It seems that copying "wget" to the /var/www/vhosts/WEBSITE.com/bin folder *could* work but only if I also copy each and every library that it wants to use. This could be a big maintenance headache as files are updated and security holes are patched.

It seems that the domain's "Scheduled Task" cron job can only access files (executables, shared libs, etc) that are in the domain directory tree. I can see that this could be considered a security enhancement but it means that many common cron jobs are likely to fail.

Is there some other trick I can use to get this to work the way that it did in Plesk 11.5?
 
If a domain is set up to allow shell access via a chrooted shell (on Linux), then the commands defined in cronjobs will be looked up inside the chrooted environment set up in the virtual host directory. Such an environment contains a minimal set of utilities and language interpreters (Perl/PHP), but network utilities (curl/wget) are not included. As such, the command will fail to run. To avoid this, you may set up the server to execute scheduled tasks for all users in the global server scope using the instructions provided in this KB article: http://kb.odin.com/115889
 
Hi all,

Just want to chime in, as I already have a schedule task up and running to execute a PHP script. I use the following:-

php -q httpdocs/cron/cron_script.php
 
In an update to this question, the following works, although I now added -O - -q to prevent cron from writing an output file every time the job is run.

I found that out purely by mistake when running a clean up on the linux os. Took me a little while to work out what the empty files where, and why they were being recreated.

So, in Plesk 12 this works for me:-

wget -O - -q http://mydomain.com/mycronjob.php
 
Last edited:
Coming in on this thread a little late but this worked for me.

None of my cron jobs was working in Plesk 12. I tried both fetch a url and run command. Both gave errors saying that the cron could not run and the url stated that the url given could not be found.

I'd set up my dedicated server to run only on IPv4 I[ addresses but it appears that Plesk only runs on IPv6 ip addresses so if you have IPv6 switched off then Plesk can not run cron jobs. I turned IPv6 on and everything runs fines.
 
Back
Top