Visit Our UNIX and Linux User Community

How to understand if a file is complete

Thread Tools Search this Thread
Operating Systems Solaris How to understand if a file is complete
# 1  
Old 08-17-2009
How to understand if a file is complete

Hi there,
files are being transferred via ftp to a folder in my machine which runs solaris 8. I would like to know if is possible to find out from my side if a file is completely transferred or not.

Is there a way to control this?

# 2  
Old 08-17-2009
you can check with "fuser" if the file is beeing handled by a process. if not, the transfer should be complete...
# 3  
Old 08-17-2009
Kindly check the file size at both end. There should be very less different in the size as size increases/decreases as per file system.

If there is any corruption in the file after download, any error should come.

If /var/adm/xferlog shows the successful download, it means correct data was downloaded.

# 4  
Old 08-17-2009
Originally Posted by naw_deepak
Kindly check the file size at both end. There should be very less different in the size as size increases/decreases as per file system.

If there is any corruption in the file after download, any error should come.

If /var/adm/xferlog shows the successful download, it means correct data was downloaded.

The problem is that I can check only in my end.
And I want to write a small script that will execute some commands after the transfer is complete in my machine.
# 5  
Old 08-17-2009
OR change the ftp statement in the download to something like this
get somefile.dat iambeingdownloaded
rename iambegindownloaded somefile.dat

if partially downloaded file show up in the directory. If a file has a reasonable name it is complete.
# 6  
Old 08-17-2009
You can do it by below ways:

Write in your script,
ftp servername
get filename

And then you can execute your desired commands. Please write if it doesn't solve your purpose.

# 7  
Old 08-24-2009
I used finally the lsof because fuser was not working.

Thanks for your help

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Understand file writing in Progress in UNIX?

Hi All, I have a requirement, where i have to pool file A data to file B continuously and need to process the data in the file B. Since the data need to be processed only once so i have to truncate the data in file A after every pool. So that on the next pooling i can get the fresh data and... (3 Replies)
Discussion started by: mayank2211
3 Replies

2. Shell Programming and Scripting

Unix Scripting : Sort a Portion of a File and not the complete file

Need to sort a portion of a file in a Alphabetical Order. Example : The user adam is not sorted and the user should get sorted. I don't want the complete file to get sorted. Currently All_users.txt contains the following lines. ############## # ARS USERS ############## mike, Mike... (6 Replies)
Discussion started by: evrurs
6 Replies

3. Shell Programming and Scripting

Insert a complete file into another file after certain fixed line

Hi Friends, I am writing a shell script where it is required to insert a file say file1 into file2 after certain number of fixed lines in file2.. Please help me how this could be done.. Please suggest me any useful links i need to go through to achieve this.... Thanks in advance .. (2 Replies)
Discussion started by: amr89
2 Replies

4. Shell Programming and Scripting

How to find complete file names in UNIX if i know only extention of file

Suppose I have a file which contains other file names with some extention . text file containt gdsds sd8ef g/f/temp_temp.sum yyeta t/unix.sum ghfp hrwer h/y/test.text.dat if then.... I want to get the complete file names, like for above file I should get output as temp_temp.sum... (4 Replies)
Discussion started by: panchal
4 Replies

5. Linux

cant understand patch file

I am trying to attach a patch file.The output I am getting is patching file net/ipv4/ip_forward.c Hunk #1 succeeded at 38 (offset -2 lines). Hunk #2 succeeded at 113 with fuzz 2 (offset -2 lines). Hunk #3 FAILED at 152. Hunk #4 succeeded at 197 (offset 1 line). 1 out of 4 hunks FAILED --... (0 Replies)
Discussion started by: akaash1087
0 Replies

6. Shell Programming and Scripting

How Get Complete Date in List of file

Hi, I am unable to get the complete date format in ls command. I need to list file with complete date format in home directory. If I give 2007/01/01 then i should get all the log files below that particular date. Pls help me (2 Replies)
Discussion started by: Satyak
2 Replies

7. Shell Programming and Scripting

complete file name displayed instead of extension

I am running my script from "/abc/" this path and it has no ".csv files" but has a ".txt" files namely temp1.txt My script goes as below, wherein it is suppose to find files with *.txt extension and *.csv extension in another path namely "/abc/xyz/": #!/bin/ksh PATH1="/abc/xyz/" value="*.csv... (7 Replies)
Discussion started by: wolverine999
7 Replies

8. UNIX for Dummies Questions & Answers

BASH complete-filename & menu-complete together

Hi, Does anyone know how to make BASH provide a list of possible completions on the first tab, and then start cycling through the possibilites on the next tab? Right now this is what I have in my .bashrc: bind "set show-all-if-ambiguous on" bind \\C-o:menu-complete This allows... (0 Replies)
Discussion started by: Mithu
0 Replies

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

10. Shell Programming and Scripting

File Processing after complete transfer

Hello everybody I have wriiten a script that, processes a file, only after its found in a particular folder, the files come in via ftp, everyday at different times, morning, afternoon and evening. The script is run every 5 minutes(0,5,10,15,20...55 minutes) of every hour. The problem i am... (8 Replies)
Discussion started by: karimone
8 Replies

Featured Tech Videos