Traduisez - Übersetzen - Traduzca - Traduza - Tradurre - Translate

VanLUG Email Archive

Re: aha!

Ted Powell
Sat, 3 Oct 1998 13:38:45 -0700

On Sat, Oct 03, 1998 at 11:08:00AM -0700, klindsay wrote:
>
> Hey Geoff,
>
> If you don't need to keep your logs for any specific reason, then you
> can just remove them. I use the method:
>
> :>/var/log/syslog
>
> This just removes all content in the log without actually removing the
> file. I found it to be very safe.

In the case of some programs that write log files, they will keep writing
at the same offset they were using before, 100MB (or whatever) along from
the beginning. The data blocks between the beginning of the file and there
don't ever take up space on the disk--unless you do a compress or a copy.

> The other way you could do it was to just remove the files:
>
> rm /var/log/syslog

In the case of some programs that write log files, they take this as a
sign that you don't want a log file any more, and they just stop logging.

> Then restart the "syslogd" daemon so that the files will be properly
> recreated. (c:

There are programs that write log files without going through the syslog
facility.

In any case, if he follows your advice, the odds are that he will have
to do it all again in a few weeks. 'logrotate' on the other hand, is a
lasting solution.

-- 



http://psg.com/~ted/ (Ted Powell) If your hard drive crashes, perhaps you have a recent backup. If Earth crashes, what then? We need off-site backup: Luna, L5, Mars, wherever.