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.

Cron and email

Discussion in 'E-mail Discussions' started by rahuldas14, Sep 22, 2011.

  1. rahuldas14

    rahuldas14 Member

    Joined:
    Nov 24, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    I want to run a script as a cron. How can I get the output of it mailed to me?
    Please dont tell me to modify the script.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    In /var/spool/cron/username file where username is the cPanel username, add the following above the cron in question:

    MAILTO="email@mydomain.com"

    This would only be the case if you have multiple cron jobs and only want this one cronjob mailed to you. Otherwise, in cPanel, you have an option for mail to be sent for all of that user's cronjobs.
     
  3. echoutt

    echoutt Member

    Joined:
    Sep 23, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    still confused about cronjob :(
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you let us know what in specific you are confused about? You can view our documentation on cron jobs at:

    Cron Jobs

    Thank you.
     
Loading...

Share This Page