Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
logrotate features
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
nemo_
Apprentice
Apprentice


Joined: 19 Sep 2002
Posts: 167
Location: Brussels, Belgium

PostPosted: Fri Feb 03, 2006 3:36 pm    Post subject: logrotate features Reply with quote

Hi All,

I have a little question about logrotate - some users might know this :
is it possible to keep running logrotate but not having it rename each and every log when it increments the indexes at the end ?

in other words: say I have blah.log, blah.log.1 and blah.log2
logrotate would then do something like this : mv blah.log.2 blah.log.3; mv blah.log.1 blah.log.2; mv blah.log blah.log.1
what I would like instead : keep blah.log.1 and blah.log.2 and rotate directly to blah.log.3

the reason why I'd like this is because this system is backed up via rdiff-backup, and since all rotated log files change between each backup run it needs to retransfer and store them all each time (alltho in fact only the name of the log file changed for all but the last one). this wastes a huge ammount of bandwith and storage.

I hope I'm making sense here =)

TIA for any good advice.
Back to top
View user's profile Send private message
madchaz
l33t
l33t


Joined: 01 Jul 2003
Posts: 995
Location: Quebec, Canada

PostPosted: Fri Feb 03, 2006 3:49 pm    Post subject: Reply with quote

Then you don't really need to use logrotate. You could just overwrite your logs couldn't you?
_________________
Someone asked me once if I suffered from mental illness. I told him I enjoyed every second of it.
Back to top
View user's profile Send private message
nemo_
Apprentice
Apprentice


Joined: 19 Sep 2002
Posts: 167
Location: Brussels, Belgium

PostPosted: Fri Feb 03, 2006 3:59 pm    Post subject: Reply with quote

well no, I do want to rotate them so they can be compressed and stored properly.
I just want the filename to be static - that is, if blah.log.3 was today's rotated log file then I'd like it to keep the same filename for ever (and not have it renamed to blah.log.4 the next day etc etc).

I know i could just write a replacement script but since logrotate is otherwise great for me it'd be much simpler if i could just get it to behave like that.
Back to top
View user's profile Send private message
Grahammm
Tux's lil' helper
Tux's lil' helper


Joined: 01 Sep 2004
Posts: 84
Location: Berkshire UK

PostPosted: Sat Feb 04, 2006 4:34 pm    Post subject: Reply with quote

Could you not use the 'dateext' option so that logrotate generates date based backups? That way you would have blah.log, blah.log-20060202.gz, blah.log-20060203.gz and when logrotate runs today it will create blah.log-20060204.gz keeping as many (or as old) logs as configured.
Back to top
View user's profile Send private message
nemo_
Apprentice
Apprentice


Joined: 19 Sep 2002
Posts: 167
Location: Brussels, Belgium

PostPosted: Sun Feb 05, 2006 6:10 pm    Post subject: Reply with quote

thanks grahammm, I will try that ! it should solve my problem indeed.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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