Ensure the file completion ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ensure the file completion ?
# 1  
Old 07-20-2007
Question Ensure the file completion ?

Hi,

I would like to copy a file from one location to another. But that particular file is not fully loaded. I like to copy a file once it's fully loaded or complete file. How to ensure whether file is fully loaded or complete file?.

-Thambi
# 2  
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.
# 3  
Old 07-20-2007
Reply

Hi,
Thanks for the inputs. I am using HP unix. I don't see this fuser command in my flavoure. Please suggest.

-Thambi
# 4  
Old 07-20-2007
Are you sure? I have used fuser on HP-UX. Check your path.
# 5  
Old 07-20-2007
Reply

I am sure , the fuser command NOT avaible in my HP.


$ which fuser
no fuser in /usr/bin /usr/bin /usr/ccs/bin /usr/contrib/bin /opt/nettladm/bin /opt/fc/bin /opt/fcms/bin /opt/upgrade/bin /opt/pd/bin /usr/bin/X11 /usr/contrib/bin/X11 /opt/hparray/bin /opt/perf/bin /opt/ignite/bin /opt/resmon/bin /usr/sbin/stm/uut/bin/progs /usr/symcli/bin /usr/local/bin /opt/cobol/bin /opt/OV/bin/OpC /opt/OV/bin /opt/graphics/common/bin /opt/gnome/bin /usr/sbin/diag/contrib /opt/mozilla /opt/wbem/bin /opt/wbem/sbin /opt/mx/bin /opt/perl/bin . /shpepr2/OraD11/Oracle/920/bin
$
# 6  
Old 07-20-2007
Thambi,
I just checked my system and 'fuser' here is located at '/usr/sbin/',
which is not listed in your path.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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

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

7. 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

8. 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

9. 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
Login or Register to Ask a Question

Featured Tech Videos