file transfer ends


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting file transfer ends
# 1  
Old 10-08-2005
file transfer ends

how can I tell when a ftp/sftp file has completed - I'm having trouble by picking up a file that is still being transferred to - is there a better way to transfer files across systems???
# 2  
Old 10-08-2005
Have you tried the toggling the hash command in ftp. Shows the transfer of data.

vino
# 3  
Old 10-09-2005
sorry I did not explain what I need - I concerned with knowing when the file transfer is completed from the perspective of the remote system not the originating system. We have automatic daemons searching the directories are looking for transferred files but HOW DO THEY KNOW WHEN THE file has been completely transferred???
THANKS-
# 4  
Old 10-09-2005
rename the file upon complete ftp to denote a complete file
# 5  
Old 10-12-2005
### Function to check if ftp was successful ### For Unix and NT
chk_ftp() {
grep -i 'Transfer complete' $TMP_DIR/ftpout.$$.log
transfer_code1=$?
echo $transfer_code1

grep -i 'Transfer finished' $TMP_DIR/ftpout.$$.log
transfer_code2=$?
echo $transfer_code2


if [ $transfer_code1 -eq 0 -o $transfer_code2 -eq 0 ]
then
echo "Successful Transfer!"
else
MessageFile="Transfer failed or data was truncated for: "
echo $MessageFile >$2
exit 14
fi
}


# Begin actual FTP process
`ftp -nv $Site <<EOT > $TMP_DIR/ftpout.$$.log 2>> $TMP_DIR/ftperr.log
user $User $Password
put $SourceFile $DestFile
bye
EOT`

# call function
chk_ftp
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Trimming ends

My files look like this I need to remove the sequence GGGAAA and anything before that I also need to remove the sequence AGCCCTA and anything after that So I will end up with something like this The left side is done but I cannot get the right side correctly. I would like to use... (3 Replies)
Discussion started by: Xterra
3 Replies

2. UNIX for Dummies Questions & Answers

UNIX command to check if file name ends with .tar OR if the file is a tar file

Hello Team, Would you please help me with a UNIX command that would check if file is a tar file. if we dont have that , can you help me with UNIX command that would check if file ends with .tar Thanks in advance. (10 Replies)
Discussion started by: sanjaydubey2006
10 Replies

3. Shell Programming and Scripting

How to find a file which are not ends with ".zip" and which are ends with "*.log*" or "*.out*"?

I am new to bash/shell scripting. I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”. I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
Discussion started by: Mallikgm
4 Replies

4. Shell Programming and Scripting

How to find a file which are not ends with ".log"?

I am new to bash/shell scripting I want to find all the files in directory and subdirectories, which are not ends with “.log”. I know below command to get the files which ends with “.log”; but I need which are not ends with this extention find /tmp/mallik5/ -iname "*.log" Please help me.... (2 Replies)
Discussion started by: Mallikgm
2 Replies

5. Shell Programming and Scripting

Execution of KSH after the Other ENDS

I have couple of scripts which I may have to execute one after the other. The Script1 creates trg files and second sciprt need to look for this trg file and proces further. I read in the forum that (./test1.sh && ./test2.sh) would work. Can you please let me know how do i use this where I need to... (3 Replies)
Discussion started by: Sukruth Kumar
3 Replies

6. Shell Programming and Scripting

Avoiding file overwrite during file transfer using scp

Hi, I have written a small script to transfer a file from one unix server to other using scp command which is working fine. As I know with scp, if any file with the same name is already present on destination server, it would get overwritten without any notification to user. Could anyone help me... (14 Replies)
Discussion started by: dsa
14 Replies

7. Programming

File transfer in C

HI Can anyone provide me with codes for file transfer server to client or vice versa? Also please explain how to compile those programs in ubuntu terminal as i am totally new to socket programming. Thanks (0 Replies)
Discussion started by: mayhemtrigger
0 Replies

8. UNIX for Dummies Questions & Answers

deletion of all lines ends with :

I have below file say temp1 BSCAJM1:HWJA10C BSCAJM1: BSCALW1: BSCALW1:GVND01B BSCALW1: BSCALW1: BSCBKNR:IJNMKTA BSCBKNR: BSCJOD1: BSCJOD1:JOD121B i want to delete all the lines ending with : and have below output BSCAJM1:HWJA10C BSCALW1:GVND01B BSCBKNR:IJNMKTA... (8 Replies)
Discussion started by: lalchand
8 Replies

9. UNIX for Dummies Questions & Answers

Transfer the file

Dear all, Can anybody let me know how to automate a file transfer process to a remote m/c thru SFTP , automate means it will not prmpt for password. how i am going to achive this....and what all methods are available or tools are available ???? (2 Replies)
Discussion started by: manas_ranjan
2 Replies

10. UNIX for Advanced & Expert Users

while never ends

Hi i have question, is this ok in ksh, like while ] do something read true done loop runs but never ends even i pass y/Y. can any body please resolve it (4 Replies)
Discussion started by: Raom
4 Replies
Login or Register to Ask a Question