[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best way to rotate log files?



> There's no need to bother with SIGHUPs if you roll
> your logs this way:
> 
>         cp log elsewhere
>         > log
> 
> The router and scheduler set the O_APPEND flag on
> the logfile, so all writes happen at the current EOF.

I have two problems with this approach:
  * it requires enough disk space to temporarily hold two copies of
    the log, which can sometimes be a problem
  * it can loose some log information (that written between the
    "cp" seeing EOF and the creat() call of the ">"); on lightly
    loaded systems this is not likely to be too much of a problem,
    but on a heavily loaded system this could potentially loose
    a few transactions

		--Ken Pizzini