User cron job not working

qspider

New member
Joined
Mar 25, 2023
Messages
3
I tried searching through the forum for this but I can't find a solution. I setup crons for a user account. The crons run fine when logged in ssh as root and run as root but not user so there's some permission issue.

Here is my cron.

/usr/local/bin/php -q /home/user/domains/user.domain.com/crons/pop.php

Seems to be some kind of permissions issue with the user.
I have also tried changing the file path /usr/local/php81/bin/php81

Also just using php -q /home/user/domains/user.domain.com/crons/pop.php

Crons are enabled in the user package. Thank you for any assistance.
 
tail -f cron shows it is executing every 5 minutes as it is supposed to but nothing happens. If I run cron as root it runs fine.

tail -f cron
Mar 25 08:00:01 web01 CROND[685523]: (username) CMD (/usr/local/bin/php -q /home/user/domains/user.domain.com/crons/pop.php)
Mar 25 08:00:01 web01 CROND[685524]: (username) CMD (/usr/local/bin/php -q /home/user/domains/user.domain.com/crons/cron.php)
 
What are the permissions on that file? Same user?
On the cron files the directory is 755 and the file has been 644 and 755. I have changed them back and forth trying to get it to work. The user owns the directories and files.
 
Make sure you get the output from cron by setting MAILTO. The output/error probably reveals the actual problem.
 
Back
Top