Thread: how to clear server log

how to clear server log

From
Amy Smith
Date:
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

Re: how to clear server log

From
Ben Chobot
Date:
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
workingfor you? 


Re: how to clear server log

From
Reid Thompson
Date:
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


Re: how to clear server log

From
Amy Smith
Date:
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:
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

Re: how to clear server log

From
Ben Chobot
Date:
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?
Asyou no doubt have realized, more logs take more space and so you can't just keep everything, but generally the more
thebetter. 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'sjust for paranoia. We do all our processing in real-time or the day after.