From: kevin lyda (kevin at domain suberic.net)
Date: Sun 09 Jul 2000 - 16:20:39 IST
On Sun, Jul 09, 2000 at 12:02:26AM +0100, Conor Daly wrote:
> Padraig Lennon wrote:
> > I basically want to know if a file (log) that is currently being written to
> > by a service, needs to be copied
> > Can it be copied without having to stop that service, renaming the file,
> > touch a new file, and restart the service?
> AFAIK, you'll be able to cp the file without probs but the *real* issue
> here is how to truncate the file once it's been copied. I presume you
> want to trim the log file after copying it. Don't know how to do it
DO NOT USE cp WITH LOG FILES. ONLY use mv, only use it on the same
partition and then touch the new log files. better still there exist
log rotation programs that you should use instead. some services
might need a HUP signal (kill -1) to restart logging.
again, look at log rotation programs. using cp on a log file can lose
some of your logs.
-- kevin at domain suberic.net "there's nothing wrong with windows 2000 that fork()'ed on 37058400 linux can't fix." -- va linux t-shirt meatspace place: home
This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:06:49 GMT