Unix Technical Forum

BUG #1531: rotated log truncation broken

This is a discussion on BUG #1531: rotated log truncation broken within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 1531 Logged by: Markus Bertheau Email address: twanger@bluetwanger.de PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:38 AM
Markus Bertheau
 
Posts: n/a
Default BUG #1531: rotated log truncation broken


The following bug has been logged online:

Bug reference: 1531
Logged by: Markus Bertheau
Email address: twanger@bluetwanger.de
PostgreSQL version: 8.0.1
Operating system: Linux FC3
Description: rotated log truncation broken
Details:

The log truncation is broken for me. It works as advertised, and I follow
the argumentation behind it, but for my scenario it is not working:

I use the computer only in work hours; it's shut down in the night.

I use the standard log rotation thing that is set up in the RPM distributed
by the PGDG.

My logs are not truncated because postgres was not running when the time
based rotation occurs.

So my logs are growing and growing :/

I see that if you would "blindly" truncate time-based rotated logs on server
start, that would be counter productive, because you may want to have the
logs of the full day.

So what about a timestamp at server shutdown, and at server start you handle
the log rotation thing as if pg ran all the time, just that nothing has
happend since that timestamp? That way the truncation would only indeed take
place if the rotation time period was over.

If that doesn't work out for some reason, I think another solution is needed
nevertheless.

Thanks for your consideration

Markus Bertheau

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:38 AM
Richard Huxton
 
Posts: n/a
Default Re: BUG #1531: rotated log truncation broken

Markus Bertheau wrote:
> The following bug has been logged online:
>
> Bug reference: 1531
> Logged by: Markus Bertheau
> Email address: twanger@bluetwanger.de
> PostgreSQL version: 8.0.1
> Operating system: Linux FC3
> Description: rotated log truncation broken
> Details:
>
> The log truncation is broken for me. It works as advertised, and I follow
> the argumentation behind it, but for my scenario it is not working:
>
> I use the computer only in work hours; it's shut down in the night.
>
> I use the standard log rotation thing that is set up in the RPM distributed
> by the PGDG.
>
> My logs are not truncated because postgres was not running when the time
> based rotation occurs.


You probably want to look at the "anacron" package - should be installed
by default. Designed for just this sort of thing.

You should find if you log to syslog it's already rotating those files.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 09:38 AM
Tom Lane
 
Posts: n/a
Default Re: BUG #1531: rotated log truncation broken

"Markus Bertheau" <twanger@bluetwanger.de> writes:
> The log truncation is broken for me. It works as advertised, and I follow
> the argumentation behind it, but for my scenario it is not working:


> I use the computer only in work hours; it's shut down in the night.


> I use the standard log rotation thing that is set up in the RPM distributed
> by the PGDG.


> My logs are not truncated because postgres was not running when the time
> based rotation occurs.


An easy answer is to change the log filename pattern so that rotation
happens hourly instead of daily. The setup created by the RPM is only
a useful default; it's not intended to be the perfect answer for everyone.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:38 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com