Results 1 to 6 of 6
-
08-11-2009, 07:11 AM #1Web Hosting Evangelist
- Join Date
- Apr 2006
- Posts
- 520
Cron not working for PHP arguments
Hello,
mydomain.com is hosted on a cPanel + RHEL 5.3 server.
I did set up the cron as follows to reset the stats on the site:
00 8 * * 0 /usr/bin/curl http://www.mywebsite.com/index.php?m=WebTraffic&a=reset
This way used to work on other scripts, but on this one seems to not parse the arguments passed trough php (?m=WebTraffic&a=reset), it just load the index.php even running the command out of the cron, just from the shell. However, running the cron from a web browser does work, it reset the stats.
I have also tried wget and it's exactly the same, from shell it doesn't work, just load the index, not the arguments, and from web works fine..
Any ideas about what I'm I missing?
Thanks.
-
08-11-2009, 07:17 AM #2Temporarily Suspended
- Join Date
- Feb 2004
- Location
- UK
- Posts
- 1,431
Hi
What you could do is
00 8 * * 0 /path/to/my/script.sh
then in script.sh have
/usr/bin/curl http://www.mywebsite.com/index.php?m=WebTraffic&a=reset
and make script.sh executable.
Thanks
-
08-11-2009, 07:21 AM #3Web Hosting Evangelist
- Join Date
- Apr 2006
- Posts
- 520
Thanks for your suggestion, but, wouldn't that be the same? As said before, from shell is not working... the curl command inside a shell script would make any difference?
Thanks.
-
08-11-2009, 07:27 AM #4Temporarily Suspended
- Join Date
- Feb 2004
- Location
- UK
- Posts
- 1,431
Hi
Its how I have got round such issues in the past.. I think that cron doesnt like the "?"
Thanks
-
08-11-2009, 10:58 AM #5Temporarily Suspended
- Join Date
- Jul 2009
- Posts
- 178
Hello,
Use lynx http://URL
-
08-11-2009, 11:18 AM #6Web Hosting Evangelist
- Join Date
- Apr 2006
- Posts
- 520
Thanks for your suggestions eth10, but it seems to be the same, launched lynx from the shell and it doesn't get the php arguments, it just load the index
Similar Threads
-
Logrotate cron not working
By LP560 in forum Hosting Security and TechnologyReplies: 9Last Post: 06-20-2007, 05:35 AM -
cron job not working properly ?
By stuartornum in forum Hosting Security and TechnologyReplies: 4Last Post: 06-09-2007, 12:41 PM -
Cron Tab not working....
By n00ber in forum Hosting Security and TechnologyReplies: 3Last Post: 01-25-2006, 11:02 PM -
Cron job not working
By Eiv in forum Hosting Security and TechnologyReplies: 4Last Post: 01-22-2002, 07:13 PM -
cron.hourly not working
By tymonhall in forum Dedicated ServerReplies: 2Last Post: 04-09-2001, 05:13 PM