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

    Exclamation Getting Daily /etc/cron.daily/logrotate error mail. Help needed.

    I am getting the following mail daily. Please help me out

    From : Cron Daemon root@server
    Subject : Cron <root@server> run-parts /etc/cron.daily

    Subject :

    /etc/cron.daily/logrotate:

    error: /etc/logrotate.conf:3 unexpected text
    error: /etc/logrotate.conf:4 lines must begin with a keyword or a filename (possibly in double quotes)
    error: /etc/logrotate.conf:6 unexpected text
    error: /etc/logrotate.conf:7 lines must begin with a keyword or a filename (possibly in double quotes)
    error: /etc/logrotate.conf:9 unexpected text
    error: /etc/logrotate.conf:10 lines must begin with a keyword or a filename (possibly in double quotes)
    error: /etc/logrotate.conf:12 unexpected text
    error: /etc/logrotate.conf:13 lines must begin with a keyword or a filename (possibly in double quotes)
    error: /etc/logrotate.conf:15 lines must begin with a keyword or a filename (possibly in double quotes)
    error: /etc/logrotate.conf:16 unexpected text
    error: /etc/logrotate.conf:17 unexpected text
    error: /etc/logrotate.conf:18 unexpected text
    error: /etc/logrotate.conf:19 unexpected text
    error: /etc/logrotate.conf:20, unexpected text after {
    error: /etc/logrotate.conf:20 lines must begin with a keyword or a filename (possibly in double quotes)
    error: /etc/logrotate.conf:21 lines must begin with a keyword or a filename (possibly in double quotes)
    error: /etc/logrotate.conf:23 lines must begin with a keyword or a filename (possibly in double quotes)

    /etc/cron.daily/logrotate File :
    Code:
    #!/bin/sh
    export TMPDIR=/var/spool/logrotate/tmp
    
    /usr/sbin/logrotate /etc/logrotate.conf
    EXITVALUE=$?
    if [ $EXITVALUE != 0 ]; then
        /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
    fi
    exit 0
    etc/logrotate.conf File :
    Code:
    # see "man logrotate" for details
    # rotate log files weekly
    weekly
    
    # keep 4 weeks worth of backlogs
    rotate 1
    
    # create new (empty) log files after rotating old ones
    create
    
    # RPM packages drop log rotation information into this directory
    include /etc/logrotate.d
    
    # no packages own wtmp -- we'll rotate them here
    /var/log/wtmp {
        monthly
        minsize 1M
        create 0664 root utmp
        rotate 1
    }
    
    # system-specific logs may be also be configured here.
    HOPE SOMEBODY HELPs
    Last edited by sahithp; 06-13-2011 at 10:26 PM.

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Getting Daily /etc/cron.daily/logrotate error mail. Help needed.

    Try this on /etc/logrotate.conf file:

    Code:
    file /etc/logrotate.conf
    It should show the following:

    Code:
    # file /etc/logrotate.conf 
    /etc/logrotate.conf: ASCII text
    If instead it shows this:

    Code:
    /etc/logrotate.conf: ASCII text, with CRLF line terminators
    Then you need to get rid of the DOS-style line ends in the file:

    Code:
    cp /etc/logrotate.conf /etc/logrotate.conf.bak110614
    dos2unix -b /etc/logrotate.conf
    If you get that dos2unix isn't installed, then first install it using yum:

    Code:
    yum install dos2unix
    At that point, then re-do the commands mentioned previously.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Registered User
    Join Date
    Jun 2011
    Posts
    2

    Default Re: Getting Daily /etc/cron.daily/logrotate error mail. Help needed.

    Now i am getting the following error mail after adding

    # file /etc/logrotate.conf
    /etc/logrotate.conf: ASCII text

    Code:
    error: /etc/logrotate.conf:2 lines must begin with a keyword or a filename (possibly in double quotes)
    error: /etc/logrotate.conf:3 unexpected text
    error: /etc/logrotate.conf:4 unexpected text
    error: /etc/logrotate.conf:5 unexpected text
    error: /etc/logrotate.conf:6 unexpected text
    error: /etc/logrotate.conf:7, unexpected text after {
    error: /etc/logrotate.conf:7 lines must begin with a keyword or a filename (possibly in double quotes)
    error: /etc/logrotate.conf:8 lines must begin with a keyword or a filename (possibly in double quotes)
    error: /etc/logrotate.conf:10 lines must begin with a keyword or a filename (possibly in double quotes)
    error: stat of /etc/logrotate.conf: failed: No such file or directory
    error: stat of ASCII failed: No such file or directory
    error: stat of text failed: No such file or directory
    error: stat of # failed: No such file or directory
    error: stat of see failed: No such file or directory
    error: stat of man logrotate failed: No such file or directory
    error: stat of for failed: No such file or directory
    error: stat of details failed: No such file or directory
    error: stat of # failed: No such file or directory
    error: stat of rotate failed: No such file or directory
    error: stat of log failed: No such file or directory
    error: stat of files failed: No such file or directory
    error: stat of weekly failed: No such file or directory
    error: stat of weekly failed: No such file or directory
    error: stat of # failed: No such file or directory
    error: stat of keep failed: No such file or directory
    error: stat of 4 failed: No such file or directory
    error: stat of weeks failed: No such file or directory
    error: stat of worth failed: No such file or directory
    error: stat of of failed: No such file or directory
    error: stat of backlogs failed: No such file or directory
    error: stat of rotate failed: No such file or directory
    error: stat of 1 failed: No such file or directory
    error: stat of # failed: No such file or directory
    error: stat of create failed: No such file or directory
    error: stat of new failed: No such file or directory
    error: stat of (empty) failed: No such file or directory
    error: stat of log failed: No such file or directory
    error: stat of files failed: No such file or directory
    error: stat of after failed: No such file or directory
    error: stat of rotating failed: No such file or directory
    error: stat of old failed: No such file or directory
    error: stat of ones failed: No such file or directory
    error: stat of create failed: No such file or directory
    error: stat of # failed: No such file or directory
    error: stat of RPM failed: No such file or directory
    error: stat of packages failed: No such file or directory
    error: stat of drop failed: No such file or directory
    error: stat of log failed: No such file or directory
    error: stat of rotation failed: No such file or directory
    error: stat of information failed: No such file or directory
    error: stat of into failed: No such file or directory
    error: stat of this failed: No such file or directory
    error: stat of directory failed: No such file or directory
    error: stat of include failed: No such file or directory
    error: stat of # failed: No such file or directory
    error: stat of no failed: No such file or directory
    error: stat of packages failed: No such file or directory
    error: stat of own failed: No such file or directory
    error: stat of wtmp failed: No such file or directory
    error: stat of -- failed: No such file or directory
    error: stat of well rotate them here
    /var/log/wtmp  failed: No such file or directory

  4. #4
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default Re: Getting Daily /etc/cron.daily/logrotate error mail. Help needed.

    You didn't add or change anything by running the command to check the file type. The file type already appears to be correct, since it is only showing ASCII text and not anything else like my examples if it did have other characters in the file.

    Can you please run the following commands and provide the output:

    Code:
    ls -lah /etc/logrotate.conf
    lsattr /etc/logrotate.conf
    We should see the following for the correct permissions:

    Code:
    root@host [~]# ls -lah /etc/logrotate.conf
    -rw-r--r-- 1 root root 520 Nov  5  2010 /etc/logrotate.conf
    
    root@host [~]# lsattr /etc/logrotate.conf
    ------------- /etc/logrotate.conf
    The reason I'm wondering what is going on with the file is that it has this error message:

    Code:
    error: stat of /etc/logrotate.conf: failed: No such file or directory
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

Similar Threads & Tags
Similar threads

  1. Daily Error Email - Cron run-parts /etc/cron.daily
    By sm9 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 04-04-2010, 10:09 PM
  2. Daily '/etc/cron.daily/logrotate' error
    By WebIdentity in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-20-2009, 07:59 PM
  3. /etc/cron.daily/logrotate
    By web12 in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-13-2003, 04:20 AM
  4. /etc/cron.daily/logrotate help needed
    By craven de kere in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 05-29-2003, 05:03 PM
  5. /etc/cron.daily/logrotate:
    By tkoweb in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-18-2003, 11:10 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube