View previous topic :: View next topic |
Author |
Message |
nemo_ Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/1119924807412ddf3f76f02.png)
Joined: 19 Sep 2002 Posts: 167 Location: Brussels, Belgium
|
Posted: Fri Feb 03, 2006 3:36 pm Post subject: logrotate features |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
madchaz l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/1845060408457ccb7bc158c.jpg)
Joined: 01 Jul 2003 Posts: 995 Location: Quebec, Canada
|
Posted: Fri Feb 03, 2006 3:49 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
nemo_ Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/1119924807412ddf3f76f02.png)
Joined: 19 Sep 2002 Posts: 167 Location: Brussels, Belgium
|
Posted: Fri Feb 03, 2006 3:59 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Grahammm Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 01 Sep 2004 Posts: 84 Location: Berkshire UK
|
Posted: Sat Feb 04, 2006 4:34 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
nemo_ Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/1119924807412ddf3f76f02.png)
Joined: 19 Sep 2002 Posts: 167 Location: Brussels, Belgium
|
Posted: Sun Feb 05, 2006 6:10 pm Post subject: |
|
|
thanks grahammm, I will try that ! it should solve my problem indeed. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|