Results 1 to 6 of 6
  1. #1
    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.

  2. #2
    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

  3. #3
    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.

  4. #4
    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

  5. #5
    Join Date
    Jul 2009
    Posts
    178
    Hello,


    Use lynx http://URL

  6. #6
    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

  1. Logrotate cron not working
    By LP560 in forum Hosting Security and Technology
    Replies: 9
    Last Post: 06-20-2007, 05:35 AM
  2. cron job not working properly ?
    By stuartornum in forum Hosting Security and Technology
    Replies: 4
    Last Post: 06-09-2007, 12:41 PM
  3. Cron Tab not working....
    By n00ber in forum Hosting Security and Technology
    Replies: 3
    Last Post: 01-25-2006, 11:02 PM
  4. Cron job not working
    By Eiv in forum Hosting Security and Technology
    Replies: 4
    Last Post: 01-22-2002, 07:13 PM
  5. cron.hourly not working
    By tymonhall in forum Dedicated Server
    Replies: 2
    Last Post: 04-09-2001, 05:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •