Solved

FTP transfer corrupted Data

Posted on 2003-11-05
6
254 Views
Last Modified: 2010-03-18
There are two machines in my company, which belong to the same LAN. One is running SCO 5.0.7, the other one is running RedHat Linux 8.0.
Everynight one file on the Linux machine is ftp'ed to the
SCO machine and get backed up. The weird thing is that 90% of the
time, the file that gets transferred is good and contains all valid data.
It is only in those 10% of the times, the file that is transfered from Linux
to the SCO ends up with some junk data or even blank pages of data in
the file, but the file size is the same as the original one on the Linux
machine !

This problem has been lingering for a while now, could anyone lend me
a helping hand? Thanks a lot !
0
Comment
Question by:bryanxin
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 9691198
When you run your job to FTP the data are you checking the exit status to see if the transfer completed successfully? My guess is that the transfer occasionlally aborts near the end and the tail end of the file is just random data in that disk block on the SCO box.
0
 

Author Comment

by:bryanxin
ID: 9696448
Thanks for the prompt help, jlevie. Do I check the exit status of FTP by doing "echo $?" or
something else? Also I have a question regarding the FTP aborts, if the FTP aborts in the
middle, why the transferred file will still end up with the same size as the size of the
original file? I understand the tail end of the file could be just the random data in that disk
on the SCO box, but it seems to be pretty odd that the random data will just be enough
to match up to the right size.

Thanks again for your help !
0
 
LVL 40

Accepted Solution

by:
jlevie earned 250 total points
ID: 9697098
Yes, exit status of FTP will be in $?. However, that may not correctly indicate the status of the transfer as it shows only whether the ftp client program terminated normally. What I use for scripted FTP transfers is ncftpget or ncftput. Its exit status, providing the get/put is only being asked to transfer a single file, will indicate the status of the transfer.

I can't really explain why you see the correct sized file with bogus data at the end. I suspect that something is going wrong, either at the server end or at the client end, but I don't really know enough about what you are doing to tell which is likely to be the culprit. Could it be that the file that's being transfered isn't closed at the time of the transfer (i.e., it's being written to by some application)? Which system is running the FTP server?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:bryanxin
ID: 9697996
Thanks for the thoughts, the one that is running the FTP server is the SCO machine.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 9698093
So that means you are doing a put from the Linux box. Provided that the file being transfered isn't being written to by some application at the time of the transfer I'd be suspicious of the server as being the casue of the bogus data at the end of the file. That might also explain why the files wind up being the correct size.

Would it be possible to install and FTP server on the Linux box and initiate the transfer from the SCO system?
0
 

Expert Comment

by:troy_
ID: 9728625
Another option would be to use scp instead of ftp.  You are transferring files using a script anyway, why not use scp?

scp is based on ssh, is more secure and I've never once seen it fail to transfer files correctly.

It would be pretty straight forward to alter your scripts to use scp instead of ftp I think.

Troy
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now