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.

My cronjobs command does not work?

Discussion in 'General Discussion' started by ArfanHaider, Feb 9, 2013.

  1. ArfanHaider

    ArfanHaider Member

    Joined:
    Jan 12, 2013
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I can set my cornjob command but it does not work

    wget -O /dev/null http://mydomainname.com/cornjod.php?anydata="something"
    can it is villade
    I want to run file through url using cornjobs how can I do that please guide me?
     
    #1 ArfanHaider, Feb 9, 2013
    Last edited: Feb 9, 2013
  2. ArfanHaider

    ArfanHaider Member

    Joined:
    Jan 12, 2013
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Cron-Jobs does not work if I run php file via URL?

    I can set a cron-job which run php file via url but it does not work.
    but path file are work well.like
    /home/path/to/file.php
    but Here is a file which I want to run via url.
    Please tell me why cron job are not work if i run file via url???????
     
  3. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Re: Cron-Jobs does not work if I run php file via URL?

    You cannot enter only a URL as a cron job command. It just will not work. A cron job needs to be a command that would be valid if you run it from the shell. As you have seen, calling a script by a path is valid in the shell; calling it via a URL is not valid in the shell.

    If you need to run a cron job by accessing it by URL, use curl to call the URL. If the objective is to call /http://mysite.com/cron.php, then make this your cron command:

    Code:
    curl http://mysite.com/cron.php
    That way, you are telling curl to get the URL for you. cron cannot do anything with a URL directly because cron is not a Web browser.
     
  4. ArfanHaider

    ArfanHaider Member

    Joined:
    Jan 12, 2013
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Re: Cron-Jobs does not work if I run php file via URL?

    I wan to run my locally file via URL due to some reason. I use curl but does not work.
     
Loading...

Share This Page