Re: [7.0.2] rotating log files ... - Mailing list pgsql-admin

From Dana Hudes
Subject Re: [7.0.2] rotating log files ...
Date
Msg-id Pine.LNX.4.21.0008281544300.32478-100000@advsol4.dsl.concentric.net
Whole thread Raw
In response to Re: [7.0.2] rotating log files ...  (Ragnar Kjørstad <postgres@ragnark.vestdata.no>)
Responses Re: [7.0.2] rotating log files ...  (Alfred Perlstein <bright@wintelcom.net>)
Re: [7.0.2] rotating log files ...  (Ragnar Kjørstad <postgres@ragnark.vestdata.no>)
List pgsql-admin
*falls over in astonishment, gagging*
*switch to CS professor mode*

Filesystem corruption result highly likely.
Reason: while you are  touching the file, so is the process.
It has a file handle open.  Actually should be locked and it would
be best if mv would honor that.
Under other operating systems such as VMS, the file would be locked
only SYSADMIN could mess with it.
Think -- Linux is a Unix variant, a true multitasking
multiprocessing operating  (with thread (lightweight process) support, no
less) system. While you are typing your mv command the process is running
unless you suspend it somehow. Therefore it is busy writing to disk
while you mess with its file. Even if you catch between writes, there is
the write cache / ouptut buffers (which is why a close is often preceded
by a fflush).

REally you need to take some basic operating systems course (or at least
read a book on the subject) if you do not understand.

I will soon have my recommended books list going and will have a book on
o/s there...


On Mon, 28 Aug 2000, [iso-8859-1] Ragnar Kj�rstad wrote:

> On Mon, Aug 28, 2000 at 02:31:29PM -0400, Chris Ryan wrote:
> > It's not normally a good idea to move/remove files that a process has an
> > open file handle for. The safest way is to copy the file to a new
> > location/name then cat /dev/null > logfile
>
> What's wrong with moving the file when it's in use?
>
> Copying the file will take much longer, and you might loose log-entries
> that are written after cp but before truncate.
>
>
>


pgsql-admin by date:

Previous
From: Ragnar Kjørstad
Date:
Subject: Re: [7.0.2] rotating log files ...
Next
From: Alfred Perlstein
Date:
Subject: Re: [7.0.2] rotating log files ...