procmail
[Top] [All Lists]

Re: strange stuff in backup directory

1997-11-12 14:04:58
Stan Ryckman found the following in his backup directory:
|   -rw-------  1 stanr        3063 Nov  4 03:31 .nfsA0c724.4
|   -rw-------  1 stanr        1780 Nov  3 23:00 .nfsA47da4.4
|   -rw-------  1 stanr         849 Nov  3 23:22 .nfsA481f4.4
|   -rw-------  1 stanr        2293 Nov 11 11:28 .nfsA737d4.4

Those look like some of the temporary names procmail uses while it is trying
to write a file out, which it renames if things go well.  I noticed that 
they
all came from a 4h 31 span overnight; perhaps there was some systems work
being done on your machine that screwed things up?

I wouldn't just blame procmail.  This seems to be an artifact of using an
NFS server to write files.  I have seen these left around by all sorts of
programs--often when a file by the "right" name has the same contents.

It is a result of using NFS, but the fault lies with the operating
system on the NFS client.  Keep in mind that NFS is stateless from the
perspective of the NFS server.  It keeps no information on how any file
is being used.  So, if a client tells the server to delete the file,
the server deletes the file.  This is not normally a problem, but many
programs use a "trick" of Unix where the program opens a file, unlinks
(deletes) it, and then continues to use the file.  For all local files,
the Unix kernel will not actually delete the file until all processes
which have the file open exit.  This works very well for temporary
files.

If a client tells an NFS server to delete a file, it will delete the file
immediately because of the stateless nature of NFS.  The server has no
way of knowing if any client still has the file open.  To avoid this
problem, if a client unlinks an open file on an NFS filesystem, the file
is renamed to .nfs* where * is a unique value.  The NFS client system
is supposed to delete the .nfs* file when the process exits.  However,
there are some versions of Unix which do not do this well (e.g., AIX).
If one of these OS's is used, it is common to find .nfs* files in
various places.  Therefore, it is a good idea for system administrators
to periodically purge any .nfs* files over a certain age to eliminate
the unsightly buildup in the filesystems.

-- 
Keith Pyle
Systems/Network Engineering
Motorola Somerset PowerPC Design Center
keith(_at_)ibmoto(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>