tags:

views:

20

answers:

1

What are the things a script should do to ensure that files have been FTPed correctly? Following are the things I have in mind:
1) use high level scripting language like python or perl instead of shell script for a more comprehensive functionality and error handling
2) check that the file exists at the destination after FTP
3) check destination file size. This is a little bit difficult because file size will change if the source and destination are running different OS. Any tips on how to go about this?

A: 

Rather than checking the file size I'd suggest creating a checksum or similar and sending separately so that you can be sure that there were no corruption. I think MD5 Hashes are quite common and so there are probably plenty of free utils or sample code.

ho1
In that case wouldn't the consumer will have to check whether a file is correct or not by validating the CRC? I don't have much control over the consumer process.
dutch
@dutch: Ah, so you just upload things to somewhere that you have no access over? The only two options I could think of then would be if either you can execute something remotely on their machine or if the files aren't very big and you really need to make sure that they're correct, you could then ftp them back to your machine and compare them with the original.
ho1
That's the answer I was afraid of :).
dutch