+ Reply to Thread
Results 1 to 4 of 4

Thread: c panel cron. jobs

  1. #1
    filoujr is offline x10Hosting Member filoujr is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    5

    c panel cron. jobs

    Hi everybody,

    I have a php file that contains a function that I would like to execute every 4 hours. Does anybody think it's possible? The function in the php file update my database.

    Thank you!

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,267

    Re: c panel cron. jobs

    Code:
    /usr/local/bin/php  /home/filoujr/public_html/somefolder/mycronjob.php
    With Unix timing entry:

    Code:
    0 */4 * * *
    cPanel also has a 'Standard' tool that you can set the script to run at 0 (on the hour) and every 4 hours
    Nothing is always absolutely so.

  3. #3
    filoujr is offline x10Hosting Member filoujr is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    5

    Re: c panel cron. jobs

    Thank you very much! =]
    Edit:
    Hi,
    I saw that i could use an e-mail address for the cron jobs, so i will get a message if the cron job is sucessful.
    I tried to use my hotmail.com email address, but i didn't receive any message in my inbox after 8 hours of waiting.

    Does anybody know if we can use external email address like hotmail.com or yahoo.com?
    Last edited by filoujr; 01-20-2010 at 12:51 PM. Reason: Automerged Doublepost

  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,267

    Re: c panel cron. jobs

    Quote Originally Posted by filoujr View Post
    Edit:
    Hi,
    I saw that i could use an e-mail address for the cron jobs, so i will get a message if the cron job is sucessful.
    I tried to use my hotmail.com email address, but i didn't receive any message in my inbox after 8 hours of waiting.

    Does anybody know if we can use external email address like hotmail.com or yahoo.com?
    Actually, the email should be sent only if
    1) the cron job fails (cannot find PHP, cannot find your script, etc)
    2) the program being run emits anything. Even a whitespace.

    If you run a php script with

    Code:
    /usr/local/bin/php -q  /home/filoujr/public_html/somefolder/mycronjob.php
    the 'q' flag and the script does not echo anything (or have blank spaces outside of the <?php ?> tags), then no email will be sent.

    And, yes, the system (at least on Chopin) does send emails to hotmail and hotmail lets them in.
    Nothing is always absolutely so.

+ Reply to Thread

Similar Threads

  1. Please Help Cron Jobs Problem
    By joyasams in forum Free Hosting
    Replies: 1
    Last Post: 10-01-2009, 07:38 AM
  2. CRON Jobs and PHP
    By deadimp in forum Tutorials
    Replies: 14
    Last Post: 11-27-2008, 06:09 PM
  3. Cron Jobs
    By HackerzInc in forum Free Hosting
    Replies: 1
    Last Post: 10-01-2008, 11:06 PM
  4. Cron Tutorial (Crontab Tutorial)
    By sunils in forum Tutorials
    Replies: 3
    Last Post: 06-14-2008, 11:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers