Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
logrotate with subdirs included
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
outspoken
Guru
Guru


Joined: 14 Feb 2004
Posts: 464
Location: orlando, fl

PostPosted: Wed Oct 19, 2005 3:07 pm    Post subject: logrotate with subdirs included Reply with quote

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
View user's profile Send private message
Quincy
Apprentice
Apprentice


Joined: 02 Jun 2005
Posts: 201
Location: Germany

PostPosted: Mon Oct 24, 2005 1:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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