File transfer aknowledgement.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting File transfer aknowledgement.
# 1  
Old 03-26-2009
File transfer aknowledgement.

Hi folks,

I have a issue regarding file transfer.

I wrote a FTP script to transfer a file from a server A to server B.
file is getting transfered script is perfect.

I want to modify script after the file transfer to server B i want to auto check through my script whether the file got transfered is completed or it is transfered incompletly I mean(file I tranfered is 100MB and got transfered only 50MB how would i check this) please suggest your views and also code if possible.

Moreover bytes or differing in both the servers.

Please reply as quick as possible im confident to get answers on this forum.Smilie


Kind RegardsSmilie
Ann.
# 2  
Old 03-26-2009
Some ideas:
  • You could parse the output of the ftp job for errors; there are usually those 3-digit codes that might be a good start; maybe described in the RFC for ftp, idk.
  • You could maybe setup ssh and just use scp and check for it's exit code.
# 3  
Old 03-26-2009
could you please code the two options!
# 4  
Old 03-26-2009
Hi,

Please do search forum..you may get more result..

below are the sample posts...

https://www.unix.com/shell-programmin...ge-script.html

FTP/SCP usage

Thanks
SHa
# 5  
Old 03-26-2009
Network

@Haque123: Put some effort yourself in it and if you get stuck you can ask for help.
# 6  
Old 03-26-2009
You can try this i have store the file size in variable origfile
and after ftp checking the dest file and the size is stored in variable destfile.

then you can mnatch the two variable and get the result
===================
#!/usr/bin/ksh

origfile=`ls -l /export/home/voipa9/live |cut -d ' ' -f 20`
ftp -v -n "172.21.142.108" << cmd
user "amit" "12345678"
cd /export/home/amit
lcd /export/home/voipa9/
bin
hash
get $1
quit
cmd

destfile=`rsh -n -l amit 172.21.142.108 "ls -l /export/home/amit/live |cut -d ' ' -f 20"`

test `expr $destfile - $origfile` == 0
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

File transfer

When using FTP to transfer a file from IBM iSeries family of servers client to a non IBM Iseries family server, files might have characters appear in the wrong format Eg | in Iseries and while transferring fro Iseries system to Linux , but instead of | it is showing as ?. Please advise (3 Replies)
Discussion started by: sudhainit
3 Replies

2. UNIX for Advanced & Expert Users

SCP File Transfer

On unix AIX server, when I am trying to transfer file from one directory to another directory on the same server through a program(where i call the script) it gives error "Lost Connection". (5 Replies)
Discussion started by: Pash
5 Replies

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

4. UNIX for Advanced & Expert Users

SCP File Transfer

I have 3 AIX server namely - Server 1 , Server 2 and Server 3. And have done SCP setup between Server 1 and Server 2 so that i dont have to give password when i transfer file from Server 1 to Server 2 by setting public key between the server. Q1. If the unix password of the target server... (3 Replies)
Discussion started by: Pash
3 Replies

5. Shell Programming and Scripting

How to transfer file from one PC to another using PERL?

Hi All I have two PC connected with each other via LAN cable. In one of the PC the Perl is installed. What I want to do is transfer the data from one PC to another via Perl. Is it possible to do this. ---------- Post updated at 11:31 PM ---------- Previous update was at 07:01 AM ----------... (10 Replies)
Discussion started by: parthmittal2007
10 Replies

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

7. Shell Programming and Scripting

Managed file transfer

Hello All, Firstly, the systems involved are Solaris 9/10 x86 and SPARC. At present, we have an internally written file transfer system that we use to manage incoming transfers and distribute the files to relevant processing systems. This is based on log watching. Over the years its become... (3 Replies)
Discussion started by: dcarrion87
3 Replies

8. Shell Programming and Scripting

File transfer

Hi All, it might not be an sound question, i have two server like A and B.. i want to transfer file from B to A ..here i have some questions.. 1) do we need to create private and public key to connect..and transferring files...from B to A..? 2) i tried with scp options like... (2 Replies)
Discussion started by: Shahul
2 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. Shell Programming and Scripting

file transfer

hi all how do i copy a file from one server to another thanks bkan77 (4 Replies)
Discussion started by: bkan77
4 Replies
Login or Register to Ask a Question