Link to home
Start Free TrialLog in
Avatar of bryanxin
bryanxin

asked on

FTP transfer corrupted Data

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 !
Avatar of jlevie
jlevie

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.
Avatar of bryanxin

ASKER

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 !
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the thoughts, the one that is running the FTP server is the SCO machine.
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?
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