Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    444
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Uruguay
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. d_t

    d_t Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    168
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice