Logrotate problem / cron

Gapert

New member
Joined
Dec 12, 2007
Messages
3
Hello everybody,

I've been searching around for quite some time now and I cannot find a solution for my problem.

I see that my Log files keep growing, without ever being rotated or renewed. For instance, in my /var/log/directadmin/system.log I can still read the tally's that were done in March this year. I found that the securing of /tmp had stopped my logrotate script from working. By adapting the logrotate program to use another directory I solved most problems. But some logs still keep growing...

On my search to a solution I came by the directory /etc/logrotate.d. In this directory I see various files like apache, apf, exim, mysql, etc. But I don't find a file called 'directadmin'. I have read somewhere on this forum that this file should be present in this map, or am I wrong?

So, can anybody please tell me if he has /etc/logrotate.d/directadmin, and what the content of the file is? I think this might be the solution to my log rotate problem, since my other logs seem to be rotated now.
 
Here is what I have in this directory:

Code:
logrotate.d]# ls -al
total 96
drwxr-xr-x   2 root root  4096 Nov  9 05:31 .
drwxr-xr-x  65 root root 12288 Dec 12 05:09 ..
-rw-r--r--   1 root root   144 Feb 21  2005 acpid
-rw-r--r--   1 root root   276 Aug 23  2006 apache
-rw-r--r--   1 root root   161 Nov  7 14:55 cups
-rwxr-xr-x   1 root root   112 Aug 30 22:36 exim
-rw-r--r--   1 root root   571 Feb 21  2005 mgetty
-rw-r--r--   1 root root   789 Jul 19  2006 mysql
-rw-r--r--   1 root root   163 Jul 24 12:51 named
-rw-r--r--   1 root root   136 Feb 21  2005 ppp
-rw-r--r--   1 root root   147 Oct  9 20:14 proftpd
-rw-r--r--   1 root root   319 Jan 17  2007 psacct
-rw-r--r--   1 root root    61 May  4  2007 rpm
-rw-r--r--   1 root root   228 Feb 21  2005 syslog
-rw-r--r--   1 root root    32 Feb 22  2001 up2date
-rw-r--r--   1 root root    89 May  5  2007 yum
 
Hmm...

I searched the forums a bit more (I feel like I've read every topic ever created :)) and I came by this; check the last post in this topic:

http://www.directadmin.com/forum/showthread.php?t=3654&highlight=/etc/logrotate.d

The post states what should be in the /directadmin file. But this topic dates back to 2004 and it hasn't been confirmed to work anymore. So, I'm still looking for the contents of "/etc/logrotate.d/directadmin". Help is greatly appreciated here!
 
Well I've found out what should be in the file. In my last post I pointed to this code:
Code:
/var/log/directadmin/*.log {
weekly
size=1M
rotate=0
sharedscripts
postrotate
find /var/log/directadmin -name "20*log*" -mtime +30 -exec /bin/rm -f {} \;
endscript
}

But I have configured daily, size, and rotate in my logrotate.conf so the final code for me was:

Code:
/var/log/directadmin/*.log {
sharedscripts
postrotate
find /var/log/directadmin -name "20*log*" -mtime +30 -exec /bin/rm -f {} \;
endscript
}

One question remains now; what does this line do exactly? What are the values for and what happens if I change them?

find /var/log/directadmin -name "20*log*" -mtime +30 -exec /bin/rm -f {} \;
 
I set mine up like this:

Code:
/var/log/directadmin/error.log /var/log/directadmin/errortaskq.log /var/log/directadmin/security.log /var/log/directadmin/system.log {
    missingok
    create 0644 diradmin diradmin
    sharedscripts
    postrotate
        find /var/log/directadmin -name "20*log*" -mtime +30 -exec /bin/rm -f {} \; >/dev/null 2>&1 || true
    endscript
}

I'm going to send this to DA and see if they'll include it with the base install. Let me know if anyone sees any problems with it.
 
Back
Top