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.

cPanel cronjob

Discussion in 'General Discussion' started by ridoyugo, Mar 15, 2009.

  1. ridoyugo

    ridoyugo Registered

    Joined:
    Mar 15, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I want to run een php script every minute, but i don't want to receive a e-mail of that. How can i do that?

    Thnx
     
  2. randomuser2

    randomuser2 Member

    Joined:
    Dec 23, 2005
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Short version: When you create the cron job, leave the email field blank.

    Better version: When you enter an email address in that field, it sets the MAILTO="user@example.com" line at the top of the user's cron job file, typically in /var/spool/cron/username, where "username" is the cPanel username of the account and "user@example.com" of the email address that you enter. By leaving the email field blank/empty when creating the cron job in cPanel, the mailto line will look like this: MAILTO="" which will effectively disable the sending of email for the cron job.

    If you do this, you will not receive email notifications for any other cron jobs you may currently have, however.
     
  3. Beat

    Beat Registered

    Joined:
    Mar 17, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    hi guys, this looks like a good place to ask: please provide me with a cron command to run a cron task for a php script.

    Thankyou

    Daniel
     
  4. Beat

    Beat Registered

    Joined:
    Mar 17, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    don't click his link guys its a backdoor Trojan, comodo internet security caught it instantly of course

    EDIT: its been removed :)
     
  5. Zishan

    Zishan Well-Known Member

    Joined:
    Aug 6, 2005
    Messages:
    104
    Likes Received:
    1
    Trophy Points:
    0

    php /path/to/file/cron.php would be sufficinet to run the php scripts via cron. You may need to define the full php path which is usually /usr/bin/php or /usr/local/bin/php. You can set the cron time as per needs. e.g You want to run a cron at 4 am every Sunday so you will set it as:

    00 4 * * 0 /usr/bin/php /home/USERNAME/public_html/cron_script.php
     
  6. Beat

    Beat Registered

    Joined:
    Mar 17, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    thankyou for your help Zishan , I really appreciate it, it's nice to find a forum where people like to help each other (except for that virus guy :p) :eek:
     
Loading...

Share This Page