Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: rolling over high-traffic logfiles?



On Jul 16,  9:36am, Zefram wrote:
} Subject: Re: rolling over high-traffic logfiles?
}
} mv should use rename() to atomically replace the log file, in which case
} there is no race condition.

Fair enough.  There are two or more filesystem operations necessary even
if only only system call, but I suppose that's only a possible problem
on a multiprocessor system.

On Jul 16,  8:46am, Brian Harvell wrote:
} Subject: Re: rolling over high-traffic logfiles?
}
} > Use "ln" and "mv" to replace the file, rather than "cp" over it.
} 
} That won't work. You are going to have to send syslog a sighup before it
} will release it's current file handle and reopen to a new one.

I assumed that this was some other kind of log, not syslog output, and
that therefore the file had to exist in order to be correctly opened and
written by the logger.  Now that I think about it, Brian's answer is more
likely the correct one, and I should have mentioned it, too.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author