Re: [7.0.2] rotating log files ...

Поиск
Список
Период
Сортировка
От Ragnar Kjørstad
Тема Re: [7.0.2] rotating log files ...
Дата
Msg-id 20000828230711.D19112@vestdata.no
обсуждение исходный текст
Ответ на RE: [7.0.2] rotating log files ...  (Neil Toronto <NToronto@Dentrix.com>)
Список pgsql-admin
On Mon, Aug 28, 2000 at 02:37:24PM -0600, Neil Toronto wrote:
> The process still has an open file handle, and will continue to do so even
> after you move it.  So, if your file is /var/log/messages, and you do a mv
> /var/log/messages /var/log/messages.old or something (I know that's stupid,
> but this is an example), the process will continue to write to
> /var/log/messages.old.

Naturally, you need to HUP the process when you're done moving the file.
(and ofcourse, you need to have the rotated version on the same
filesystem)

> The best way is what Chris said: copy the file, and cat /dev/null > logfile.
> That'll truncate it well.

Copying the file will take much longer, and you might loose log-entries
that are written after cp but before truncate.

--
Ragnar Kjorstad

В списке pgsql-admin по дате отправления:

Предыдущее
От: Ragnar Kjørstad
Дата:
Сообщение: Re: [7.0.2] rotating log files ...
Следующее
От: Palle Girgensohn
Дата:
Сообщение: Re: [7.0.2] rotating log files ...