Sponsored Content
Full Discussion: Ensure the file completion ?
Top Forums Shell Programming and Scripting Ensure the file completion ? Post 302127894 by blowtorch on Friday 20th of July 2007 03:10:19 AM
Old 07-20-2007
Let me get this straight. You want to copy a file from one location to another, and you want to copy it only if the file is a complete file? As in, some application that might be creating the file has completed creating the file?

You can use the 'fuser -fu' command to check if a process is using the file. If there is none, you can go ahead and move the file. If a process is using the file, it likely to be the process that is creating the file, so you should wait, sleep and look back to run fuser again.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

file name completion

I'ld like to enable file name completion in ksh88 on AIX 5.2. My terminal is set to xterm. I've set the shell editor to emacs and ampped the arrow keys. Is there a way to map the tab key to a command like ESC= or any other file name completion command in emacvs that I may be not aware of since I'm... (1 Reply)
Discussion started by: rein
1 Replies

2. UNIX for Dummies Questions & Answers

Ensure FTP is complete before using file

Hi, I have a program that checks a directory for new files. A file may be placed in the directory only via FTP from another system. The files are long, the FTP can take several minutes to complete. my program sences that a file has arrived but can't tell if the FTP process that sent it is... (10 Replies)
Discussion started by: GMMike
10 Replies

3. Shell Programming and Scripting

link scripts to file extensions for tab completion

Is there a way to link a script in my ~/bin with file extension priority for tab completion? for example, if the script I have could only look at .tex files, and I have 6 files in the same directory with the same name, but different extensions: index.tex index.dvi index.toc ... etc... it... (0 Replies)
Discussion started by: pyramation
0 Replies

4. Shell Programming and Scripting

Ensure file copy is complete before starting process

Hi experts, I have a requirement wherein a user is uploading a file to the Landing directory on one of our Linux servers. A cron job is scheduled to run after every 5 minutes which will pick up the files from the source (Landing) dir and copy to the target dir, and once successfully copied to... (4 Replies)
Discussion started by: adi_2_chaos
4 Replies

5. Shell Programming and Scripting

File name auto completion not working in KSH.Please help

Hi All, I am using SunOS 5.8 verison with KSH shell. My problem is I am not getting auto completion of file name on pressing of TAB or ESC key. While pressing ESC key , '^[' is getting printed . TAB is printing doin nothin but jus printing tab. What should I do to get auto completion of... (3 Replies)
Discussion started by: Sooraj_Linux
3 Replies

6. Shell Programming and Scripting

Auto completion of file name in KSH.

Hi All, I am using SunOS 5.8 verison with KSH shell. My problem is I am not getting auto completion of file name on pressing of TAB or ESC key. While pressing ESC key , '^[' is getting printed . TAB is printing doin nothin but jus printing tab. What should I do to get auto completion of... (2 Replies)
Discussion started by: Sooraj_Linux
2 Replies

7. Shell Programming and Scripting

How to ensure a script can only be invoked from another?

Hi All, I have two scripts - ScriptA and ScriptB ScriptA has logic to invoke ScriptB : - with some parameter - or without any parameter ScriptB can also be invoked by the user from the command line. Is there anyway to ensure that when I execute ScriptB from the command line, it does... (3 Replies)
Discussion started by: chaitanya.gvc
3 Replies

8. Shell Programming and Scripting

Identifying the file completion

Hi, A script is running for multiple databases so data is also being populated for multiple DBs in a.txt file. I need to rename this file once all the data is populated. Kindly suggest me How can I check once file is populated completely before renaming? Thanks in advance. (3 Replies)
Discussion started by: ravigupta2u
3 Replies

9. Shell Programming and Scripting

Check the file processed Completion

Hi, I have a wierd requirement where i need to check for a file transfered to my Server and once it is completed i need to start processing my jobs. My server is AIX 6.0 and i want to know is there some way in unix i can keep on checking the file and once it is completed successfully i can... (5 Replies)
Discussion started by: prasson_ibm
5 Replies
fuser(1M)																 fuser(1M)

NAME
fuser - list processes using a file or file structure SYNOPSIS
file ... file ...] ... DESCRIPTION
The command lists the process IDs of processes that have each specified file open. For block special devices, all processes using any file on that device are listed. The process ID may be followed by a letter, identifying how the file is being used, as follows: file is current directory of the process. file is the root directory of the process, as set up by the command (see chroot(1M)). The process has file open. The process has file memory mapped. file is the text file of the process. The process IDs associated with each file are printed to standard output as a single line separated by spaces and terminated with a single newline. All other output -- the file name, the letter, and the user name -- is written to standard error. Options has the following options: Display the use of a mount point and any file beneath that mount point. Each file must be a file system mount point. Display the use of the named file only, not the files beneath it if it is a mounted file system. This is the default. Display the login user name in parentheses following each process ID. Send the signal to each process using each file. You must have appropriate privileges to kill processes that you do not own. You can respecify options between groups of files. The new set of options replaces the old set. A dash by itself cancels all options cur- rently in force. Operands has the following operand: file One of the following values: o With the option, the name of a file. o With the option, the name of a mounted file system or special file. o With the option, the name of a file system mount point. NETWORKING FEATURES
You can use with NFS file systems or files. If the file name is in the format used in to identify an NFS file system, treats the NFS file system as a block special device and identifies any process using that file system. If contact with an NFS file system is lost, fails, since contact is required to obtain the file system identification. Once the NFS file system is recontacted, stale file handles from the previous contact can be identified, provided that the NFS file system has the same file system identification. EXAMPLES
Terminate all processes that are preventing disk drive 1 from being unmounted, listing the process ID and login name of each process being killed. List process IDs and login names of processes that have the password file open. Combine both the above examples into a single command line. If the device is mounted on directory list the process IDs and login names of processes using the device. Alternately, if is the mount point for an NFS file system, list process IDs and login names of processes using that NFS file system. If is an NFS file system, list all processes using any file on that file system. If it is not an NFS file system, treat it as a regular file. SEE ALSO
ps(1), mount(1M), kill(2), signal(2). STANDARDS CONFORMANCE
fuser(1M)
All times are GMT -4. The time now is 02:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy