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.

Crontab Failure Emails

Discussion in 'E-mail Discussions' started by dbaxt, Aug 6, 2011.

  1. dbaxt

    dbaxt Member

    Joined:
    Jun 30, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I'm not sure what's changed on my dedicated server, but I've started getting hundreds of emails a day that appear to be cron failure emails.

    Server wise I'm running WHM 11.30.2 (build 1), CENTOS 5.6 x86_64 standard.

    The emails vary in subject line but include:
    Cron <root@beach> /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    Cron <root@beach> /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1

    And all have the same body content:
    /bin/sh: 1
    : ambiguous redirect

    etc/crontab content:
    Code:
    35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpanel/bin/tail-check
    30 */2 * * * /usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1
    15 */2 * * * /usr/local/cpanel/bin/dbindex >/dev/null 2>&1
    3,18,33,48 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_c$
    45 */8 * * * /usr/bin/test -x /usr/local/cpanel/bin/optimizefs && /usr/local/cpanel/bin/optimizefs
    */5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
    13 1 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
    0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1
    45 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_mailman_cache && /usr/local/cpanel/scripts/update$
    15 */6 * * * /usr/local/cpanel/scripts/recoverymgmt >/dev/null 2>&1
    00 04 * * * /scripts/cleanmailtrash.sh
    42 3 * * * /usr/local/cpanel/scripts/upcp --cron
    2,58 * * * * /usr/local/bandmin/bandmin
    0 0 * * * /usr/local/bandmin/ipaddrmap
    58 17 * * * /usr/local/cpanel/scripts/cpbackup
    
    Does anybody have any idea what is causing this or how to fix it please? I have already ran /scripts/upcp --force and made sure that /dev/null exists.

    Thanks in advance...
     
  2. dbaxt

    dbaxt Member

    Joined:
    Jun 30, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Doesn't anyone have any ideas? Or is there some additional information that would help troubleshooting?
     
  3. 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
    Just to be clear, can you provide the full output of one of the example emails which includes all information (other than your email address). With the mention for varying subjects, I'm slightly confused what is being sent. Having just one example email with the full output for that email would be helpful.

    My main thought is that something in /var/spool/cron/root is likely parsing improperly such as possible Windows line returns in the file due to someone editing it improperly.

    You can always check to see if that might be the case:

    Code:
    file /var/spool/cron/root
    If it is properly terminating lines and formatted, you'll get something returning like this:

    Code:
    /var/spool/cron/root: ASCII text
     
  4. dbaxt

    dbaxt Member

    Joined:
    Jun 30, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hi Tristan,
    Thanks for your reply.

    Running
    Code:
    file /var/spool/cron/root
    Returns:
    Code:
    /var/spool/cron/root: ASCII text, with CRLF, LF line terminators
    
    And here's a full email:

    Many thanks for your help so far
     
  5. dbaxt

    dbaxt Member

    Joined:
    Jun 30, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    After a bit of searching on here and Google I ran

    Code:
    cp /var/spool/cron/root /var/spool/cron/root.bak110811
    dos2unix -b /var/spool/cron/root
    And the emails now seem to have stopped - thanks for your help Tristan...
     
  6. 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
    Certainly, you are welcome. When you get something like you did, it indicated that root's crontab at /var/spool/cron/root was modified outside Linux at some point and corrupted for the line endings. dos2unix command will almost always fix that issue.
     
Loading...

Share This Page