Sponsored Content
Full Discussion: Removing ".nfs" files
Special Forums Hardware Filesystems, Disks and Memory Removing ".nfs" files Post 19643 by Perderabo on Monday 15th of April 2002 07:10:10 AM
Old 04-15-2002
In unix, it is ok to create a file, then unlink it, and continue to read and write to it. When you remove the last link to a file, it becomes a file with zero names. But the inode will not be freed until all processes close it. This is often done with temporary files. If the process aborts, the file will go with it.

It is hard to implement this in an nfs environment. If a nfs client gets a request from a local process to delete a file, it checks to see if any local processes still have that file open, if so, it renames the file to a .nfs<something> file. And after the last local process closes the file, the nfs client will actually issue the delete.

If you are running a process on a nfs client and that process attempts a unlink() system call on a open file, the above scenario plays out. But the process still has the file open. You should be glad that .nfs file is still around. You must be holding the file open in order to eventually do i/o to it. If this is not the case, the process has a bug. It should close the file if the file is no longer needed. If the process is going to run for days or weeks and it is opening files that it will never close, the file table will eventually fill.

The .nfs files should not really cause any trouble unless they are very large. Some people run a cron job on the nfs server that finds .nfs files that have not been accessed in the past two weeks and deletes them.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

removing the "\" and "\n" character using sed or tr

Hi All, I'm trying to write a ksh script to parse a file. When the "\" character is encountered, it should be removed and the next line should be concatenated with the current line. For example... this is a test line #1\ should be concatenated with line #2\ and line number 3 when this... (3 Replies)
Discussion started by: newbie_coder
3 Replies

2. Shell Programming and Scripting

Unix commands delete all files starting with "X" except "X" itself. HELP!!!!?

im a new student in programming and im stuck on this question so please please HELP ME. thanks. the question is this: enter a command to delete all files that have filenames starting with labtest, except labtest itself (delete all files startign with 'labtest' followed by one or more... (2 Replies)
Discussion started by: soccerball
2 Replies

3. Shell Programming and Scripting

Delete files older than "x" if directory size is greater than "y"

I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y" #!/bin/bash du -hs $1 while read SIZE ENTRY do if ; then find $1 -mtime +$2 -exec rm -f {} \; echo "Files older than $2 days deleted" else echo "free Space available"... (4 Replies)
Discussion started by: JamesCarter
4 Replies

4. Solaris

Removing "Failed none for" error messages from sshd logs files

We have a number of system running the same patch level, OS version and sshd version. The systems also have the same sshd config and syslog.conf entries , however one of the systems keeps logging the following message everytime someone logs in: Nov 16 09:36:02 server389 sshd: Failed none for... (3 Replies)
Discussion started by: Mr_Webster
3 Replies

5. Shell Programming and Scripting

"Join" or "Merge" more than 2 files into single output based on common key (column)

Hi All, I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations: 1. I am restrained to 2 input files only. 2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

8. Shell Programming and Scripting

Removing "^M" from the end of a String (i.e. "Ctrl+M")?

Hello All, I have an Expect script that ssh's to a remote server and runs some commands before exiting. One of the commands I run is the "hostname" Command. After I run this command I save the output using this line in the code below... Basically it executes the hostname command, then I... (2 Replies)
Discussion started by: mrm5102
2 Replies

9. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
SRV(3)							     Library Functions Manual							    SRV(3)

NAME
srv - server registry SYNOPSIS
bind #s /srv #s/service1 #s/service2 ... DESCRIPTION
The srv device provides a one-level directory holding already-open channels to services. In effect, srv is a bulletin board on which pro- cesses may post open file descriptors to make them available to other processes. To install a channel, create a new file such as /srv/myserv and then write a text string (suitable for strtoul; see atof(2)) giving the file descriptor number of an open file. Any process may then open /srv/myserv to acquire another reference to the open file that was reg- istered. An entry in srv holds a reference to the associated file even if no process has the file open. Removing the file from /srv releases that reference. It is an error to write more than one number into a server file, or to create a file with a name that is already being used. EXAMPLE
To drop one end of a pipe into /srv, that is, to create a named pipe: int fd, p[2]; char buf[32]; pipe(p); fd = create("/srv/namedpipe", 1, 0666); sprint(buf, "%d", p[0]); write(fd, buf, strlen(buf)); close(fd); close(p[0]); write(p[1], "hello", 5); At this point, any process may open and read /srv/namedpipe to receive the hello string. Data written to /srv/namedpipe will be received by executing read(p[1], buf, sizeof buf); in the above process. SOURCE
/sys/src/9/port/devsrv.c SRV(3)
All times are GMT -4. The time now is 07:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy