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.

Need Help of CRON Job

Discussion in 'General Discussion' started by amarvora, Apr 9, 2005.

  1. amarvora

    amarvora Registered

    Joined:
    Apr 9, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hello Friends.,

    I have make my website in PHP. I want to put some programming with the help of cron job.
    But I am unknown for LINUX and cron command. I have seen my cPanel there is a option of Cron job. and in that there is a one text field of "Command :- [_______] " But i dont know what command I have to type in this textfield. So please if anyone knows that cron command then please tell me what should i have to type??

    Thank you very much..
     
  2. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    There are a lot of commands that work, here are some examples that work for php scripts:

    lynx --dump http://DOMAIN/PATH_TO_CRON_FILE > /dev/null
    ~~~~~~~~~~~~~

    php /home/USERNAME/public_html/PATH_TO_CRON_FILE

    ~~~~~~~~~~~~~

    php -f /home/USERNAME/public_html/PATH_TO_CRON_FILE
    ~~~~~~~~~~~~~

    /usr/bin/wget -q -O /dev/null http://DOMAIN/PATH_TO_CRON_FILE
    ~~~~~~~~~~~~~

    wget -q --delete-after http://www.DOMAIN/PATH_TO_CRON_FILE
    ~~~~~~~~~~~~~

    GET http://DOMAIN/PATH_TO_CRON_FILE> /dev/null

    ~~~~~~~~~~~~

    /usr/bin/curl --silent http://www.DOMAIN/PATH_TO_CRON_FILE > /dev/null
    (curl has to be installed for this one to work)

    ===================================

    can also use instead of url:
    http://<IP>/~USERNAME/

    EX:
    lynx --dump http://12.34.567.890/~USERNAME/PATH_TO_CRON_FILE > /dev/null


    And here are some helpful links where you can learn more about crons:

    http://forums.cpanel.net/showthread.php?t=32191
    http://www.phpfreaks.com/tutorials/28/0.php
    http://www.interspire.com/whitepapers/html/Introduction_to_Cron.html
     
    #2 junglecat, Apr 9, 2005
    Last edited: Apr 9, 2005
  3. amarvora

    amarvora Registered

    Joined:
    Apr 9, 2005
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    thank you very much

    Hello Friend

    First of thank you very much for such a nice response...

    Now i want to tell you that.. I have entered this command
    /bin/php -q /home/mymodule/public_html/cron.php

    but when I received mail in that it says /bin/sh: /bin/php: No such file or directory

    Now what I have to do for this problem ???
     
  4. jester.ro

    jester.ro Well-Known Member
    PartnerNOC

    Joined:
    Feb 6, 2004
    Messages:
    304
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bucharest, Romania
    cPanel Access Level:
    DataCenter Provider
    put php, not /bin/php

    the error you got means that the php bynary is not in /bin

    usually is in /usr/local/bin/php

    but simply putting php as the command usually works
     
Loading...

Share This Page