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

VanLUG Email Archive

Re: aha!

klindsay
Sat, 3 Oct 1998 17:22:45 -0700 (PDT)

Hmm... I use this method on high end production machine which produce
large log files quite quickly. I just wrote a bash rotation script which
has been working for the last few months without a hitch. I just :>
/var/log/(logfile) and it seems be working great. And I've never
experienced any gaping holes from daemons writing at the previous offset.
Since syslog handles all of our logs I probably don't have to worry, but
yes if a daemon wrote its own logs writing to the previous offset, (Which
seems wacky to me, any idea why this would be done?) it would leave
gapping holes.

But yes indeed, stop syslogd or any daemons that are writing their own log
files first. (c:

Cheers,

On Sat, 3 Oct 1998, Ted Powell wrote:

> 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.
>