Re: How to properly empty log files

2008-10-20 Thread T o n g
On Sat, 18 Oct 2008 11:47:12 +, Tzafrir Cohen wrote: >> > you can "truncate" the file with the folowing bash line : >> > > /var/log/mail.err >> >> > or the following portable line : >> > echo > /var/log/mail.err >> >> Neither of those will work in this instance, as the file is held open >> f

Re: How to properly empty log files

2008-10-20 Thread Chris Davies
On Fri, Oct 17, 2008 at 09:44:43AM +0100, Chris Davies wrote: > Neither of those [truncating a log file] will work in this instance, > as the file is held open for writing [...] Tzafrir Cohen <[EMAIL PROTECTED]> wrote: > Are you sure? The above method [truncation] works fine for me. Presumably yo

Re: How to properly empty log files

2008-10-18 Thread Tzafrir Cohen
On Fri, Oct 17, 2008 at 09:44:43AM +0100, Chris Davies wrote: > François Cerbelle <[EMAIL PROTECTED]> wrote: > > you can "truncate" the file with the folowing bash line : > > > /var/log/mail.err > > > or the following portable line : > > echo > /var/log/mail.err > > Neither of those will work in

Re: How to properly empty log files

2008-10-17 Thread Chris Davies
François Cerbelle <[EMAIL PROTECTED]> wrote: > you can "truncate" the file with the folowing bash line : > > /var/log/mail.err > or the following portable line : > echo > /var/log/mail.err Neither of those will work in this instance, as the file is held open for writing. On the next write, the da

Re: How to properly empty log files

2008-10-16 Thread François Cerbelle
T o n g a écrit : My /var/log/mail.err is very big due to a misconfiguration error. However, I can't simply remove it because it is "owned" by rsyslogd: [...] So, how to properly empty log files? Hi, If you dont want to : - restart syslog - keep the information in the file you can "truncate

Re: How to properly empty log files

2008-10-16 Thread Sam Leon
T o n g wrote: Hi, My /var/log/mail.err is very big due to a misconfiguration error. However, I can't simply remove it because it is "owned" by rsyslogd: $ lsof | grep mail.err rsyslogd 4387 root 10w REG8,9 17605899 247416 /var/log/mail.err So, how to properly