how to clear server log

Started by Amy Smithabout 16 years ago5 messagesgeneral
Jump to latest
#1Amy Smith
vah123@gmail.com

All

do you clean up the server file by removing them
use

find $logfile -mtime +$NUMBER_DAYS_TO_KEEP -type f -print -exec rm -f {} \;

in postgres ?

How to remove the archive log files in postgres ? is the same way as remove
backup files and server log files ?

thanks
Amy

#2Ben
bench@silentmedia.com
In reply to: Amy Smith (#1)
Re: how to clear server log

On Feb 23, 2010, at 11:49 AM, Amy Smith wrote:

All

do you clean up the server file by removing them
use

find $logfile -mtime +$NUMBER_DAYS_TO_KEEP -type f -print -exec rm -f {} \;

in postgres ?

How to remove the archive log files in postgres ? is the same way as remove backup files and server log files ?

Usually log rotator logic will overwrite old logs with new ones, and you don't have this problem. Why is that not working for you?

#3Reid Thompson
Reid.Thompson@ateb.com
In reply to: Amy Smith (#1)
Re: how to clear server log

On Tue, 2010-02-23 at 13:49 -0500, Amy Smith wrote:

All

do you clean up the server file by removing them
use

google logrotate
man logrotate

#4Amy Smith
vah123@gmail.com
In reply to: Amy Smith (#1)
Re: how to clear server log

this is the server log file, how many days server log files need to be keep
as a mimumum ?

thanks

On Tue, Feb 23, 2010 at 1:49 PM, Amy Smith <vah123@gmail.com> wrote:

Show quoted text

All

do you clean up the server file by removing them
use

find $logfile -mtime +$NUMBER_DAYS_TO_KEEP -type f -print -exec rm -f {}
\;

in postgres ?

How to remove the archive log files in postgres ? is the same way as remove
backup files and server log files ?

thanks
Amy

#5Ben
bench@silentmedia.com
In reply to: Amy Smith (#4)
Re: how to clear server log

On Feb 24, 2010, at 7:57 AM, Amy Smith wrote:

this is the server log file, how many days server log files need to be keep as a mimumum ?

thanks

That question is up to you to answer. How far back do you want to be able to look? What do you do with your log files? As you no doubt have realized, more logs take more space and so you can't just keep everything, but generally the more the better. As a data point that may or may not be good advice for you, we keep a week's worth of log files, but mostly that's just for paranoia. We do all our processing in real-time or the day after.