On Sun, Oct 28, 2001 at 12:22:40AM +0200, Cyrille Lefevre wrote:
> > The traditional log-rotation dance goes something like:
> > 
> > mv log log.0
> > touch log
> 
> never do a mv/touch on a log file to avoid full filled file systems,
> use cp instead...
> 
> cp log log.0
> (there is a delta here which can be handled w/ tail -0 -f)
> cp /dev/null log
> 
> this has the advantage to work w/ every daemons, even the ones wich
> don't handle SIGHUP as well as simple redirections (daemon > log).

Using cp will make you lose log entries.

When a file is renamed, all programs with the file open continue
writing to the new name.  That is, if you run syslog, and then "mv
log log.0", you will now find it writing entries to log.0.  If you
copy, you create a log.0, but syslog is still writing to log.  Thus
any log entries from when cp finishes to when your next {cp/touch}
is run are lost.

-- 
       Leo Bicknell - [EMAIL PROTECTED] - CCIE 3440
        PGP keys at http://www.ufp.org/~bicknell/
Read TMBG List - [EMAIL PROTECTED], www.tmbg.org

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to