The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cron not working for PHP arguments

Discussion in 'General Discussion' started by sh4ka, Aug 11, 2009.

  1. sh4ka

    sh4ka Well-Known Member

    Joined:
    May 12, 2005
    Messages:
    442
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    US
    cPanel Access Level:
    DataCenter Provider
    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. d_t

    d_t Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    243
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Bucharest
    & is a special shell character (run a process in background). Try to quote entire URL:

    /usr/bin/curl "http://www.mywebsite.com/index.php?m=WebTraffic&a=reset"
     
Loading...

Share This Page