error running postrotate script, all details included
I have a problem with my logrotate, everytime it tries to rotate the logs, it sends me this email:
/etc/cron.daily/logrotate:
error: error running postrotate script
error: error running postrotate script
error: error running postrotate script
error: error running postrotate script
error: error running postrotate script
error: error running shared postrotate script for /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron
error: error running postrotate script
error: error running postrotate script
error: error running postrotate script
error: error running postrotate script
error: error running postrotate script
error: error running shared postrotate script for /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron
Code:
/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron { sharedscripts postrotate /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true endscript }
Code:
weekly rotate 4 create include /etc/logrotate.d /var/log/wtmp { monthly create 0664 root utmp rotate 1 }
Code:
#!/bin/sh /usr/sbin/logrotate /etc/logrotate.conf EXITVALUE=$? if [ $EXITVALUE != 0 ]; then /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" fi exit 0

All my log files are in /var/log/ and most of them DONT get rotated.

Here is a look into some of the files in /var/log/ (WHAT IS THAT strange wtmp thing?)
... [cut] ...
-rw------- 1 root root 0 Feb 5 04:02 maillog
-rw------- 1 root root 0 Jan 29 04:02 maillog.1
-rw------- 1 root root 0 Jan 22 04:02 maillog.2
-rw------- 1 root root 0 Jan 15 04:02 maillog.3
-rw------- 1 root root 2199284 Feb 5 13:33 maillog.4
-rw------- 1 root root 0 Feb 5 04:02 messages
-rw------- 1 root root 0 Jan 29 04:02 messages.1
-rw------- 1 root root 0 Jan 22 04:02 messages.2
-rw------- 1 root root 0 Jan 15 04:02 messages.3
-rw------- 1 root root 7965754 Feb 5 13:33 messages.4
-rwx------ 1 postgres postgres 0 Dec 27 13:40 pgsql*
-rw-r--r-- 1 root root 16007 Feb 3 04:02 prelink.log
-rw-r--r-- 1 root root 138 Feb 5 13:30 raidstatus
-rw-r--r-- 1 root root 15261 Feb 5 04:02 rpmpkgs
-rw-r--r-- 1 root root 15261 Feb 4 04:02 rpmpkgs.1
-rw-r--r-- 1 root root 15241 Jan 28 04:02 rpmpkgs.2
-rw-r--r-- 1 root root 15241 Jan 21 04:02 rpmpkgs.3
-rw-r--r-- 1 root root 15193 Jan 14 04:03 rpmpkgs.4
drwxr-xr-x 2 root root 4096 Feb 5 00:00 sa/
-rw------- 1 root root 0 Feb 5 04:02 secure
-rw------- 1 root root 0 Jan 29 04:02 secure.1
-rw------- 1 root root 0 Jan 22 04:02 secure.2
-rw------- 1 root root 0 Jan 15 04:02 secure.3
-rw------- 1 root root 1101246 Feb 5 13:33 secure.4
-rw------- 1 root root 0 Feb 5 04:02 spooler
-rw------- 1 root root 0 Jan 29 04:02 spooler.1
-rw------- 1 root root 0 Jan 22 04:02 spooler.2
-rw------- 1 root root 0 Jan 15 04:02 spooler.3
-rw------- 1 root root 0 Jan 8 04:02 spooler.4
-rw-r--r-- 1 root root 24239 Nov 28 10:28 stunnel-4.04-build.log
-rw-rw-r-- 1 root utmp 1920 Feb 5 13:27 wtmp
-rw-rw-r-- 1 root utmp 46848 Jan 30 20:54 wtmp.1
lrwxrwxrwx 1 root root 41 Dec 27 15:02 xferlog -> ../../usr/local/apache/domlogs/ftpxferlog
-rw-r--r-- 1 root root 2 Feb 5 01:54 xferlog.offset
-rw-r--r-- 1 root root 2 Feb 5 13:21 xferlog.offsetftpsep
-rw-r--r-- 1 root root 9373 Feb 3 01:54 yum.log
-rw------- 1 root root 0 Feb 5 04:02 maillog
-rw------- 1 root root 0 Jan 29 04:02 maillog.1
-rw------- 1 root root 0 Jan 22 04:02 maillog.2
-rw------- 1 root root 0 Jan 15 04:02 maillog.3
-rw------- 1 root root 2199284 Feb 5 13:33 maillog.4
-rw------- 1 root root 0 Feb 5 04:02 messages
-rw------- 1 root root 0 Jan 29 04:02 messages.1
-rw------- 1 root root 0 Jan 22 04:02 messages.2
-rw------- 1 root root 0 Jan 15 04:02 messages.3
-rw------- 1 root root 7965754 Feb 5 13:33 messages.4
-rwx------ 1 postgres postgres 0 Dec 27 13:40 pgsql*
-rw-r--r-- 1 root root 16007 Feb 3 04:02 prelink.log
-rw-r--r-- 1 root root 138 Feb 5 13:30 raidstatus
-rw-r--r-- 1 root root 15261 Feb 5 04:02 rpmpkgs
-rw-r--r-- 1 root root 15261 Feb 4 04:02 rpmpkgs.1
-rw-r--r-- 1 root root 15241 Jan 28 04:02 rpmpkgs.2
-rw-r--r-- 1 root root 15241 Jan 21 04:02 rpmpkgs.3
-rw-r--r-- 1 root root 15193 Jan 14 04:03 rpmpkgs.4
drwxr-xr-x 2 root root 4096 Feb 5 00:00 sa/
-rw------- 1 root root 0 Feb 5 04:02 secure
-rw------- 1 root root 0 Jan 29 04:02 secure.1
-rw------- 1 root root 0 Jan 22 04:02 secure.2
-rw------- 1 root root 0 Jan 15 04:02 secure.3
-rw------- 1 root root 1101246 Feb 5 13:33 secure.4
-rw------- 1 root root 0 Feb 5 04:02 spooler
-rw------- 1 root root 0 Jan 29 04:02 spooler.1
-rw------- 1 root root 0 Jan 22 04:02 spooler.2
-rw------- 1 root root 0 Jan 15 04:02 spooler.3
-rw------- 1 root root 0 Jan 8 04:02 spooler.4
-rw-r--r-- 1 root root 24239 Nov 28 10:28 stunnel-4.04-build.log
-rw-rw-r-- 1 root utmp 1920 Feb 5 13:27 wtmp
-rw-rw-r-- 1 root utmp 46848 Jan 30 20:54 wtmp.1
lrwxrwxrwx 1 root root 41 Dec 27 15:02 xferlog -> ../../usr/local/apache/domlogs/ftpxferlog
-rw-r--r-- 1 root root 2 Feb 5 01:54 xferlog.offset
-rw-r--r-- 1 root root 2 Feb 5 13:21 xferlog.offsetftpsep
-rw-r--r-- 1 root root 9373 Feb 3 01:54 yum.log