Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    2

    Lightbulb Need Help of CRON Job

    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. #2
    Member junglecat's Avatar
    Join Date
    Jul 2004
    Posts
    168

    Default

    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/whitepaper...n_to_Cron.html
    Last edited by junglecat; 04-09-2005 at 10:23 AM.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    2

    Lightbulb 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. #4
    cPanel Partner NOC cPanel Partner NOC Badge jester.ro's Avatar
    Join Date
    Feb 2004
    Location
    Bucharest, Romania
    Posts
    304

    Default

    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

Similar Threads & Tags
Similar threads

  1. Cron Job Help Please...
    By mikka12 in forum New User Questions
    Replies: 5
    Last Post: 07-12-2010, 09:49 PM
  2. How to cron job?
    By dachooch in forum New User Questions
    Replies: 4
    Last Post: 05-03-2010, 09:15 AM
  3. about cron job
    By persianwhois in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-14-2007, 09:28 AM
  4. cron job
    By albertldee in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-11-2003, 01:08 AM
  5. Cron Job
    By Dawson in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 10-13-2001, 08:06 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube