• 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

update.cron.php: not found

L

LucasVN

Guest
HI,

My cron jobs are not working and I got an email telling me:

/usr/local/psa/home/vhosts/domain.com/httpdocs/modules/Server_List/cronjobs/update.cron.php:not found

But when I logged in to ssh, and I found the file exactly in there and the permission is even set to 777.

What do you think is the problem? How can I solve this?

Thanks
 
There are several problems may be here.

1) some intermediate directory has wrong permissions and do not allow your user account to read itself.
2) it can be a problem with your command line PHP interpreter

To check all above try to start your script from the command line with your user account. If it works OK, then all above is OK.

user$ /usr/local/psa/home/vhosts/domain.com/httpdocs/modules/Server_List/cronjobs/update.cron.php
 
I tried it run manually in the command line, and it says: command not found....

but the file is in there. :(
 
OK. So the problem is not in a cron. Th problem is in your script. Check the first line of you script. It must be something like this:

#!/path/to/php

If it so, then check that /path/to/php exists and runnable.

If you first line is not looks like that, then you need to start you script with exact php command, something like this:

user$ /path/to/php usr/local/psa/home/vhosts/domain.com/httpdocs/modules/Server_List/cronjobs/update.cron.php

of course, /path/to/php must exist and must be runnable anyway
 
Hi

Thanks! You hit it! the path inside the script is not found. I tried running it in the command line using the correct path of php and it runs.

I changed the path inside the script to the correct path and I also ln -s the correct path to the default path..

Thanks again
 
Still have errors.. :( now permission denied...

maybe the group or something...
 
HI,

What is the best to implement this..?

I checked on updated.cron.php and it is pointing to /usr/bin/php which is does not exist.

I search for the php and I found serveral instances, two of them are /usr/local/psa/admin/bin/php
and /usr/local/psa/apache/bin/php

I tried ln-s any of these files to /usr/bin/php but I'm experiencing permission error on my email, but when I tried /usr/local/psa/admin/php /path/to/update.cron.php it has no error on command line.

I also tried changing the owner and group of the php to match the update.cron.php but to no avail.

Anybody can help?

Thanks
 
You probably made all tests under "root" user, right? But you need to do tests via the normal user, which owns crontab.

So once more. Login to the system with normal user account, not root. Make sure that you can start the commad through the comand line. The command must be exact as you see it in crontab.

You get permission denied because the directory /usr/local/psa/admin - do not allow the normal user to read it for the security reason.

So I suggest you to use /usr/local/psa/apache/bin/php. If it does not work, then set up your own php interpreter and use it.
 
Hi,

I set the php to use /usr/local/psa/apache/bin/php and then I logged in using useraccount and not root.

I then type in the command line php update.cron.php and it runs.

But when I run in website, I got an error message again in my email telling me update.cron.php not found.
 
Anybody can help??

I'm still at loss in here. What I did now is to run the cron inside ssh at /etc/crontab using php -q /path/to/cronjobst.php but to no avail, I have several weird errors. I really don't know if where is the problem, on my previous server with Plesk also, this command just worked fine...

What do you think?

Thanks
 
Write here what command you use inside crontab, i.e. run command "crontab -l" and put its output here.

You mentioned, that right now you receive weird errors by email. Is it the same errors (not fount) or something else?
 
Hi,

using a normal user, I edited /etc/crontab and added this:

0 0 * * * otcom php -q /usr/local/psa/home/vhosts/domain.comt/httpdocs/modules/Server_List/cronjobs/stats.date.cron.php
5 0 * * * otcom php -q /usr/local/psa/home/vhosts/domain.com/httpdocs/modules/Server_List/cronjobs/stats.draw.date.cron.php
5 * * * * otcom php -q /usr/local/psa/home/vhosts/domain.com/httpdocs/modules/Server_List/cronjobs/stats.draw.hour.cron.php
0 * * * * otcom php -q /usr/local/psa/home/vhosts/domain.com/httpdocs/modules/Server_List/cronjobs/stats.hour.cron.php
*/15 * * * * otcom php -q /usr/local/psa/home/vhosts/domain.com/httpdocs/modules/Server_List/cronjobs/update.cron.php

using root user, I type crontab -l:

14 5 * * * /usr/local/psa/bin/mysqldump.sh >/dev/null 2>&1
7 4 * * * /usr/local/psa/admin/sbin/statistics >/dev/null 2>&1
30 * * * * /usr/local/psa/admin/sbin/backupmng >/dev/null 2>&1
17 7 * * * /usr/local/psa/admin/bin/php /usr/local/psa/admin/plib/report/autoreport.php --auto daily >/dev/null 2>&1
17 7 * * 1 /usr/local/psa/admin/bin/php /usr/local/psa/admin/plib/report/autoreport.php --auto weekly >/dev/null 2>&1
17 7 1 * * /usr/local/psa/admin/bin/php /usr/local/psa/admin/plib/report/autoreport.php --auto monthly >/dev/null 2>&1

Thanks
 
I think it is not good idea to edit /etc/crontab. I suggest you to restore /etc/crontab file to its original contents. And use "crontab -e" command under normal user to edit its crontab.
 
Back
Top