Cron Jobs failing.. need help!

software development

#1

Hi all
I’m experiencing some weird problems with my cronjobs.
I have some php scripts that need to be run with a cron job and up until a couple of days they did run with no problem

It all began to break down then, when all such scripts stopped running in their regular scheduled fashion. All of them read external config files and DB connection scripts (first ones with php file() and the latter with a require() ). the problem is that these scripts are failing because, when run as crons, the system can’t seem to open the includes and config files
(for example: Warning: file(status.txt): failed to open stream: No such file or d
irectory in /home/.patenkats…)

odd thing: If I run the scripts directly from the address bar in my browser, they do run with no problem and they access the config files and DB connection scripts with no problem whatsoever. It only fails when running as cron

This has taken a solid 4 hours of work but I’m still lacking a solution. Keep in mind that, even without any changes to my files, all crons stopped working suddenly after being operative for months… I would really appreciate any help you guys could give

btw… site runs on php5


#2

Another guy had a issue recently where cronjobs that functioned on other’s accounts didn’t work on his own.
Maybe permissions have been changed somewhere inadvertently.

You might try copying your jobs, deleting the current tab, and inserting a fresh one.


#3

Hi, thanks for your reply

I actually did all that. All crons were cleared and set up again but didn’t work. The thing just refuses to open the scripts related to the cron when the cron runs.

Any ideas?


#4

What process are you using to call the php scripts?


#5

thanks again for replying

I got it to work!
The crons were set up to run in the regular fashion (i.e. /usr/bin/php /path/to/script or something similar) which worked fine until some time ago.
I solved it calling the scripts through /usr/bin/wget in the cron and it is back online, yay!

thanks for the interest in helping me!

cheers from Chile