[syslog-ng]deleting log files - syslog-ng]

Christian Hammers ch@westend.com
Fri, 26 Oct 2001 12:26:04 +0200


Hello

On Fri, Oct 26, 2001 at 12:11:48PM +0200, Thomas Kaehn wrote:
> 		cp /some/where/file.log /some/where/old/file.log.old
> 		cp /dev/null /some/where/file.log
> 	This way, file still exists and file descriptos are not closed.
> 	However, this is not atomic, one might lose logged lines before
> 	file is truncated.
Better idea:
	mv logfile logfile.old 	
	kill -WHATEVER syslog-ng	
This way it would continue writing into the moved file until I restart it
which would flush buffers, close the file and then crate a new one.

But a fstat() call at each write would be a more elegant solutuion if it
doesn't slow down writing too much.

> 		-MNi
bye,

 -christian-

-- 
Christian Hammers    WESTEND GmbH - Aachen und Dueren     Tel 0241/701333-0
ch@westend.com     Internet & Security for Professionals    Fax 0241/911879
           WESTEND ist CISCO Systems Partner - Premium Certified