开发者

Good practices for a robust FTP script

开发者 https://www.devze.com 2023-01-03 11:47 出处:网络
What are the things a script should do to ensure that files have been FTPed correctly? Followin开发者_StackOverflowg are the things I have in mind:

What are the things a script should do to ensure that files have been FTPed correctly? Followin开发者_StackOverflowg 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号