![]() There have been cases where people have complained that lftp will return an exit status of 0 even if a non-existing file is requested to be transferred, but I have never encountered such issues. ![]() Lftp seems to be a bit better than ftp when it comes to exit status codes. If you are on Linux and if lftp is not installed, install the lftp package using your default package manager. Another way to verify that a file transfer is successful is to transfer the file back and check the md5sum of the file.ġ50 Opening BINARY mode data connection for foo.barġ1 bytes sent in 0.00018 seconds (61111 bytes/s)Īn alternative and better method is to use the lftp command instead of the ftp command in the shell script. But in such scenarios, typically the FTP server will send a 426 (Connection closed transfer aborted) reply first followed by a 226 reply. ![]() I would say that this is also not a foolproof method – the FTP server can send a 226 reply in response to a FTP abort command as well. If One of them will be called depending on the contents of the ftp command output. The improved script above has 2 functions: transfer_ok and transfer_nok.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |