?
Solved

FTP transfer corrupted Data

Posted on 2003-11-05
6
Medium Priority
?
275 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
[X]
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
  • 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 1000 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
WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

 

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

762 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