• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

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 !
0
bryanxin
Asked:
bryanxin
  • 3
  • 2
1 Solution
 
jlevieCommented:
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
 
bryanxinAuthor Commented:
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
 
jlevieCommented:
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bryanxinAuthor Commented:
Thanks for the thoughts, the one that is running the FTP server is the SCO machine.
0
 
jlevieCommented:
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
 
troy_Commented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now