SUMMARY: .nfsxxx files

From: Craig Ledbetter (cledbett@homeaccount.com)
Date: Fri Nov 08 1996 - 16:18:58 CST


Hi all,
        Apparently .nfsxxx files are created when a process is working with a
file and the file gets deleted by another process. The .nfsxxx file
ensures that original process that was using the file doesn't lose the
data. Once the processes are done with the file it really isn't needed
and a root cronjob is supposed to remove them when they are a week old.
I don't know if I belive that the files arn't needed once the processes
are done, but if the data isn't missed after a week I always have
backups. For some reason my nfs server did not have a crontab entry for
nfsfind (the script that does the cleaning after a week), and nfsfind
was missing from the filesystem (I inherited this system, and keep
finding little things like this). Thank you to Jim Craven who provided
nfsfind to me in his response. For anyone who my need it here it is,
along with the crontab entry that I was able to copy from another
system.

# crontab -l
#ident "@(#)root 1.12 94/03/24 SMI" /* SVr4.0 1.1.3.1 */
#
# The root crontab should be used to perform accounting data collection.
#
0 0 * * * /bin/cp /dev/null /var/mail/root
0 2 * * 0,4 /etc/cron.d/logchecker
5 4 * * 6 /usr/lib/newsyslog
15 3 * * * /usr/lib/fs/nfs/nfsfind
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

# more /usr/lib/fs/nfs/nfsfind
#!/bin/sh
# Copyright (c) 1993 by Sun Microsystems, Inc.

#ident "@(#)nfsfind.sh 1.4 93/05/18 SMI" /* */
#
# Check shared NFS filesystems for .nfs* files that
# are more than a week old.
#
# These files are created by NFS clients when an open file
# is removed. To preserve some semblance of Unix semantics
# the client renames the file to a unique name so that the
# file appears to have been removed from the directory, but
# is still usable by the process that has the file open.

if [ ! -s /etc/dfs/sharetab ]; then exit ; fi

for dir in `awk '$3 == "nfs" {print $1}' /etc/dfs/sharetab`
do
        find $dir -name .nfs\* -mtime +7 -mount -exec rm -f {} \;
done

Thanks to all who responded (my applogies to anyone I have missed)

Paul Kanz <paul@icx.com>
Milt Webb <milt@iqsc.com>
Ian MacPhedran <Ian_MacPhedran@engr.USask.Ca>
Alex Finkel <afinkel@pfn.com>
mshon@sunrock.East.Sun.COM (Michael J. Shon {*Prof Services} Sun Roch...
jjenson@ect.enron.com (Jarod Jenson)
Reto Lichtensteiger <rali@meitca.com>
craven@cg.NRCan.gc.ca (Jim Craven)

Craig Ledbetter
Systems Engineer
Home Account Network Inc.
cledbett@homeaccount.com
http://www.homeaccount.com



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:15 CDT