View previous topic :: View next topic |
Author |
Message |
outspoken Guru
Joined: 14 Feb 2004 Posts: 464 Location: orlando, fl
|
Posted: Wed Oct 19, 2005 3:07 pm Post subject: logrotate with subdirs included |
|
|
what im looking for is logrotate to reach into subdirs and rotate files in there.
dir example:
/var/log/directory/1
/var/log/directory/2
/var/log/directory/3
inside each (1,2,3) there are the files where I want to rotate. I would just put those three lines in manually but there are about 2,000+ dirs that need rotating. this is what i would like to do in /etc/logrotate.d/conf
Code: |
/var/log/directory/*/* {
sharedscripts
rotate 14
weekly
missingok
nocreate
compress
compressoptions -6
endscript
}
|
which would essentially look into all dirs within /var/log/directory. however, this does not work. so i tried a regex instead and logrotate does not like regex.
i am not going to replace the log system on this server, is there an alternative here or a way to make logrotate look into subdirs dynamically? |
|
Back to top |
|
|
Quincy Apprentice
Joined: 02 Jun 2005 Posts: 201 Location: Germany
|
Posted: Mon Oct 24, 2005 1:48 am Post subject: |
|
|
I have no problems with this syntax, but i know the file names because they are weblogs:
/home/*/www/logs/*/access_log /home/*/www/logs/*/error_log
Perhaps this is possible for you because there are many directories, but not much files.
Even if it doesn't work in the moment: Be careful with * in the final directory, it rotates EVERY file even the old compressed ones
What do you want sharedskripts and endskripts to do? Please look into documentation again...your syntax seems wrong |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|