Sponsored Content
Top Forums Shell Programming and Scripting Detecting data loss during FTP Post 37410 by Perderabo on Wednesday 18th of June 2003 10:50:23 AM
Old 06-18-2003
The algorithms that sum originally used have been discredited. If you use the sum command, use -p so that you get a crc check. Or just use cksum instead. The crc algorithm is the champ as far as detecting data corruption. That is why the TCP layer is performing a crc on every arriving packet.

The only time I have ever seen the "flag file" used is to know when the last of a collection of files have arrived. Once the flag file appears, you know that you have everything and you can use the data. I do not understand why your colleague's advice in this case. You will have to ask him to explain.

Nor do I understand your fixation on the the 226 return code. I am unable to tell if you think 226 means that file was transferred ok or if you think that 226 means there was a problem. But that doesn't matter, neither view is correct.

According to the rfc:
Quote:
226 Closing data connection.
Requested file action successful (for example, file transfer or file abort).
226 really just means that the data connection is closed. In the case of an abort, it is clear that the file has not been transferred. It is common to close the data connection after a file has been transferred, but it is not required. The data connection is not held open for all eternity under any conditions. If you open a data connection, the time will come that it is closed.
Quote:
The data connection shall be closed by the server under the conditions described in the Section on Establishing Data Connections. If the data connection is to be closed following a data transfer where closing the connection is not required to indicate the end-of-file, the server must do so immediately. Waiting until after a new transfer command is not permitted because the user-process will have already tested the data connection to see if it needs to do a "listen"; (remember that the user must "listen" on a closed data port BEFORE sending the transfer request). To prevent a race condition here, the server sends a reply (226) after closing the data connection (or if the connection is left open, a "file transfer completed" reply (250) and the user-PI should wait for one of these replies before issuing a new transfer command).
Paying close attention to the arrivial of a 226 would be crucial if you were writing an ftp client. That is not what you're doing.
 

6 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

data corruption with ftp transfer

Hi again, first of all thanks for you help on my last problem, the problem is solved now. But I have many problem :) This time, I transfered a big file, ~3,5 GByte, with ftp from a Sun machine to a linux box, RedHat 7.3. But the file recieved on the Linux Box is corrupt, with smaller files... (12 Replies)
Discussion started by: malcom
12 Replies

2. UNIX for Advanced & Expert Users

Response time under packet loss

I am experiencing a problem where under a dial condition I am experiencing packet loss, which is failrly normal, but the response to the packet loss is taking bewteen 6 and 10 seconds. Could someone please advise what the industry standard is on the response time under a packet loss senario. (1 Reply)
Discussion started by: shane
1 Replies

3. Shell Programming and Scripting

Detecting a successfull FTP connection

I have a question. My company has to send a file to another company. The cron script currently just sends the file. However, every now and then the other companies ftp server is down. I wanted to alter my script to detect if the server is up before I attempt to send the file. My idea follows #... (2 Replies)
Discussion started by: beilstwh
2 Replies

4. IP Networking

packet loss problem

I have 4 network ports on our T5240 sun server. all but 1 gives packet losses (nxge1) nxge0 gives on average 50% packet loss, very bad. nxge2 gives on average 1-2% packet loss. nxge3 gives on average 20% packet loss. Is there a tool or something to help me find the problem? (11 Replies)
Discussion started by: photon
11 Replies

5. Shell Programming and Scripting

Download data from ftp.

Dear all, I am beginner to shell scripting. I have to download more than 1k files from ftp site. link is below ftp://ftp.ncbi.nih.gov/genomes/Bacteria/ Earlier i was using wget url, for download but the problem is some times folder names get changed, i don't know how to move in directories... (4 Replies)
Discussion started by: admax
4 Replies

6. Solaris

Packet loss on ce interface.

Hi, I am using the ce interface on my Solaris 9 server and there is significant packet loss when transmitting large packets. Does anyone have a fix for this? ----10.1.0.0 PING Statistics---- 51 packets transmitted, 42 packets received, 17% packet loss round-trip (ms) min/avg/max =... (12 Replies)
Discussion started by: sparcman
12 Replies
IO::All::FTP(3pm)					User Contributed Perl Documentation					 IO::All::FTP(3pm)

NAME
IO::All::FTP - Extends IO::All to FTP URLs SYNOPSIS
use IO::All; "hello world " > io('ftp://localhost/test/x'); # save to FTP io('ftp//example.org/pub/xyz') > io('xyz'); # GET to file # two ways of getting a file with a password: $content < io('ftp://me:secret@example.org/xyz'); $content < io('ftp://example.org/xyz')->user('me')->password('secret'); DESCRIPTION
This module extends IO::All for dealing with FTP URLs. Note that you don't need to use it explicitly, as it is autoloaded by IO::All whenever it sees something that looks like an FTP URL. METHODS
This is a subclass of IO::All::LWP. The only new method is "ftp", which can be used to create a blank IO::All::FTP object; or it can also take an FTP URL as a parameter. Note that in most cases it is simpler just to call io('ftp//example.com'), which calls the "ftp" method automatically. OPERATOR OVERLOADING
The same operators from IO::All may be used. < GETs an FTP URL; > PUTs to an FTP URL. SEE ALSO
IO::All::LWP, IO::All, LWP. AUTHORS
Ivan Tubert-Brohman <itub@cpan.org> and Brian Ingerson <ingy@cpan.org> COPYRIGHT
Copyright (c) 2007. Ivan Tubert-Brohman and Brian Ingerson. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See <http://www.perl.com/perl/misc/Artistic.html> perl v5.10.0 2007-03-29 IO::All::FTP(3pm)
All times are GMT -4. The time now is 03:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy