File arrival status


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting File arrival status
# 1  
Old 08-15-2005
File arrival status

If there is a file being transferred from one box to another box, How can one confirm on the 2nd box..that the file has arrived, and transfer is complete ?

I mean in addition to checking the file exists, I want to confirm its transferred completely and not growing in size.
# 2  
Old 08-15-2005
How are you transferring the file - by ftp or scp?
scp will give you the transfer status - ie. 100% transferred..

With ftp - you could do some file checking on the 2nd node..
Check the size of the file on the 2nd node - against the size on the 1st
# 3  
Old 08-15-2005
If a file is stil in transit there will be at least one process on the local machine that has it 'open'. In which case you can use the lsof command

lsof <path to file>

If there is any output then its in use and probably still in transit.
# 4  
Old 08-16-2005
Thanks for the feedback. Can somebody give some sample code...and also I am not transerring file..I am just receiving on 2nd box. transfer is done thru scp.
# 5  
Old 08-16-2005
Quote:
Originally Posted by amsh76
Can somebody give some sample code....
erm... unbeliever already has given you the "sample code"

If you don't have lsof... use fuser....

an example
Code:
root@host> rcp somehost:/path/to/somefile .
^Z
Suspended
root@host> bg
[1]    rcp  ... &
root@host> ls
somefile
root@host> fuser ./somefile 
./somefile:    15455o
root@host> ps -ef | grep 15455
    root 15596 14653  0 12:43:52 pts/5    0:00 grep 15455
    root 15455 14653  5 12:43:33 pts/5    0:13 rcp somehost:/path/to/somefile .
root@host> kill -9 15455
root@host> 
[1]    Killed                        rcp  ...
root@host> fuser ./somefile
./somefile:
root@host> rm ./somefile

Cheers
ZB
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

How to track table status delete/update/insert status in DB2 V10 z/os?

Dear Team I am using DB2 v10 z/os database . Need expert guidance to figure out best way to track table activities ( Ex Delete, Insert,Update ) Scenario We have a table which is critical and many developer/testing team access on daily basis . We had instance where some deleted... (1 Reply)
Discussion started by: Perlbaby
1 Replies

2. Shell Programming and Scripting

Check daily files arrival in a directory

Hi All, I wanted to write a script to check if set of files exist in a directory or not for a particular day. each file has a date stamp. Now i want to implement this - -i can check files of a particular date in a particular folder -generate log and send it to through email. Big THANKS !!... (5 Replies)
Discussion started by: flagboy2014
5 Replies

3. UNIX for Dummies Questions & Answers

Script shell calculate mean arrival request duration

hello, I have implemented this command : tshark -eth0 -T fiels -e frame.time et sip.Request-Line -z sip,stat > test2.txt the result of this command : test.txt: Aug 27, 2013 23:06:47.334270000 INVITE Aug 27, 2013 23:06:47.335045000 SIP/2.0 401 Unauthorized Aug 27, 2013... (1 Reply)
Discussion started by: Amouna
1 Replies

4. Shell Programming and Scripting

Need File arrival time(sftp) command

Hi All, I am getting some file through using sftp from another server to my server. I want know the exact file arrival time on my sytem I have tried stat command . it gives me the below details $ stat abc.txt File: `abc.txt Size: 24231 Blocks: 48 IO Block:... (5 Replies)
Discussion started by: aish11
5 Replies

5. Shell Programming and Scripting

shell script to get the arrival count of file

Hello All, I have come across a small problem. It would be great if any of you could help me in resolving the issue. one file named dummy.txt will be ftped to Unix machine twice daily. If i receive it second time in a day i need to do some processing with the file. How to find the... (2 Replies)
Discussion started by: RSC1985
2 Replies

6. Shell Programming and Scripting

need to invoke a script upon arrival of a file

hi all, i recieve a file from other server, on a daily basis .... but the time of arrival is unpredictable .... i need to move this file to another directory before the next file arrives ... i have written a script that does this op and performs some manipulations on the data... but i... (2 Replies)
Discussion started by: sais
2 Replies

7. Programming

How to detect usb storage arrival and its mount path from C

Hi, I am a newbi to linux, i wana to write a program in C that can detect arrival of a usb flash memory. I want also to find the actual mount point of new inserted flash disk. can anyone help me? thanks a lot (6 Replies)
Discussion started by: aghashahi
6 Replies

8. Red Hat

Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58

I have successfully installed RedHat 8.0 onto a Dell PowerEdge SC1425 today. This server has two SATA hard drives, and an IDE DVD-ROM drive. Using the following kernel parameters, i successfully installed across both hard drives from CD: ide0=0x1f0,0x3f6,14 vga=791 resolution=1024x768 expert... (5 Replies)
Discussion started by: fishsponge
5 Replies

9. Shell Programming and Scripting

check the status and send an email with status

Hi, We have a text file which has the following data. ISA~00~ ~00~ ~ZZ~VISTN ~ZZ~U1CAD ~051227~183 7~U~00200~000011258~0~P~< GS~FA~EE05J~U1CAD~051227~1831~000011258~X~002002 ST~997~0001 AK1~SH~247 AK2~856~2470001 AK5~A AK2~856~2470002 AK5~A... (3 Replies)
Discussion started by: isingh786
3 Replies

10. UNIX for Dummies Questions & Answers

Couldn't open status file /var/samba/STATUS.LCK

I believe i have most of samba configured right but i get this error each time time try to run it. I was given suggestion that i touch the file, i did, but i still cannot rid myself of this error. Any suggestions (2 Replies)
Discussion started by: macdonto
2 Replies
Login or Register to Ask a Question