|
Hello friends, I have been stuck into very strange situation from past one week. I have to run cron.php of my drupal site periodically. For that I have set a cron job in crontab file using wget. But the wget is not executing inside crontab file. when I run wget seperatally from commandline i.e /usr/bin/wget http://localhost/cron.php it is working but when I write same wget in crontab file as /2 * * * /usr/bin/wget http://localhost/cron.php cron is running but the changes are not happening in the site. the var/log/syslog shows the cron run but the changes are not happening in the site. In drupal's Administer page there is a Reports section inside which there is a subsection recent log entries. The cron run should show in that recent log entries subsection. For wget run directally from commandline the recent log entries is showing the cron run but when wget is run from cron job the cron run is not showing in recent log entries. I also tried to write the wget in an script & then running that script from crontab file by setting cron job but even that is not working. I am tired of seraching this issue on net no real solution is given every where I find the same thing 'give full path' 'check syslog file' . These thing I have already checked but everything seems to be correct. So please help with the real solution. Thanx a lot in advance |
|
You can see what's happening by logging the output of the cronjob to a file. This can be done by appending the following to your crontab line: If this doesn't help you determine what the problem is, please open a ticket so we can take a look at this issue for you. Hello Seanf, Thanks a lot for your suggestion. I tried with the line you mentioned to generate log file & it is working fine. In the log file output I came to know that cron is working fine but the problem is with the proxy setting & all. I am pasting here the output of the log file:- Looking up 172.16.16.3:8080 Making HTTP connection to 172.16.16.3:8080 Sending HTTP request. HTTP request sent; waiting for response. Alert!: Invalid header 'Proxy-Authenticate: NTLM' Alert!: Invalid header 'Proxy-Authenticate: Kerberos' Alert!: Invalid header 'Proxy-Authenticate: Negotiate' Alert!: Can't retry with proxy authorization! Contact the server's WebMaster. Can't Access `http://localhost/jkportal/cron.php' Alert!: Unable to access document. lynx: Can't access startfile Now I would like to share that I have unset the proxy using unset http_proxy command already and my wget, lynx & a script which is calling lynx is working finwe through commandline but only through crontab file it is generating the above message. Please guide me about what to do next and if you require furthur details then please mention about it. Thanks a lot again. You can try running wget with the --no-proxy parameter. If this doesn't help, please open a ticket, so we can take a look at your cronjob and try to troubleshoot it for you. Thanks Todork for your suggestions. Finally my cron is working. As suggested by you I tried with the no proxy option and it started running. So I got my solution. Thanks again for your inputs I hope I will learn a lot from you in future also. Thumbs Up You are most welcome! Glad I could help. |