I have the following problem. When my logs are rotated something like that is procuded
-rw-r--r-- 1 root admin 169K Sep 24 12:15 messages -rw-r--r-- 1 root admin 0 Sep 24 04:03 messages.1 -rw-r--r-- 1 root admin 0 Sep 19 04:02 messages.11 -rw-r--r-- 1 root admin 20 Aug 22 04:03 messages.1.gz -rw-r--r-- 1 root admin 0 Sep 23 04:02 messages.3 -rw-r--r-- 1 root admin 20 Aug 21 04:02 messages.3.gz -rw-r--r-- 1 root admin 0 Sep 22 04:02 messages.5 -rw-r--r-- 1 root admin 20 Aug 20 04:02 messages.5.gz -rw-r--r-- 1 root admin 0 Sep 21 04:02 messages.7 -rw-r--r-- 1 root admin 20 Aug 19 04:03 messages.7.gz -rw-r--r-- 1 root admin 0 Sep 20 04:02 messages.9 -rw-r--r-- 1 root admin 20 Aug 18 18:02 messages.9.gzAs you can see the even numbers are not compress, but the odd are. Any the most important is that there is not log kept !
My logrotate is the following …
Blah Blah { nocompress sharedscripts rotate 12 weekly postrotate /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true endscript }What could be wrong ?
Answer
At last the problem is solved. The problem was that some of the directories were links to other directories, thus they were rotated twice. !!!!!!! It had as a result the produced files to be null !
Attribution
Source : Link , Question Author : Nikolaidis Fotis , Answer Author : Nikolaidis Fotis