[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

logfiles' rotation doesn't work at all...



Dear debian-users,

In spite of the sysklogd scripts in /etc/cron.daily and
/etc/cron.weekly my system's log files keep growing and growing.
In fact they never have been rotated since potato's installation
in October 2000...

Here are the relevant entries in my /etc/cron.daily/sysklogd:

    #! /bin/sh

    cd /var/log
    for LOG in `syslogd-listfiles`
    do
       if [ -f $LOG ]; then
          savelog -g adm -m 640 -u root -c 7 $LOG >/dev/null
       fi
    done

    for LOG in `syslogd-listfiles --auth`
    do
       if [ -f $LOG ]; then
          chown root.adm $LOG
          chmod o-rwx $LOG
       fi
    done

    /etc/init.d/sysklogd reload

My /etc/cron.weekly/sysklogd looks like this:

    #! /bin/sh

    cd /var/log
    for LOG in `syslogd-listfiles --weekly`
    do
       if [ -f $LOG ]; then
          savelog -g adm -m 640 -u root -c 4 $LOG >/dev/null
       fi
    done

    for LOG in `syslogd-listfiles --auth`
    do
       if [ -f $LOG ]; then
          chown root.adm $LOG
          chmod o-rwx $LOG
       fi
    done

    /etc/init.d/sysklogd reload

'syslogd-listfiles --auth' gives me:

    /var/log/auth.log

'syslogd-listfiles' lists:

    /var/log/messages
    /var/log/kern.log
    /var/log/syslog
    /var/log/debug

'syslogd-listfiles --weekly' returns:

    /var/log/messages
    /var/log/mail.warn
    /var/log/mail.err
    /var/log/mail.info
    /var/log/uucp.log
    /var/log/lpr.log
    /var/log/user.log
    /var/log/kern.log
    /var/log/auth.log
    /var/log/mail.log
    /var/log/daemon.log
    /var/log/debug

Logfiles must not occur in /etc/cron.weekly and /etc/cron.daily
simultaneously. This would affect the following:

    /var/log/messages
    /var/log/kern.log
    /var/log/debug
    /var/log/auth.log

I would like to exclude everything but /var/log/syslog in
/etc/cron.daily/sysklogd, like this:

    # /bin/sh
    cd /var/log
    savelog -g adm -m 640 -u root -c 7 /var/log/syslog >/dev/null
    /etc/init.d/sysklogd reload

-but it doesn't work :(

Would someone please let me know how to fix this?
How do I edit my sysklogd scripts properly?
How do I determine what is listed in 'syslogd-listfiles' and
'syslogd-listfiles --weekly'?

Thank you in advance.
Andreas.



Reply to: