Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

FTP transfer corrupted Data

Posted on 2003-11-05
6
266 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 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