Hi, I've a directory that is watched for the event write-close. When I get this event I assume that the file is received totally. Is it correct? What is the behavior of openssh when a transfer failed? ( Server side ). Micka,
A write-close can happen on transfer failure. It also can happen multiple times if you are doing a parallel transfer. Thanks, Kevin ________________________________________ From: openssh-unix-dev <openssh-unix-dev-bounces+kevin.fox=pnnl.gov at mindrot.org> on behalf of Micka <mickamusset at gmail.com> Sent: Tuesday, December 1, 2020 4:21 PM To: openssh-unix-dev at mindrot.org Subject: Openssh server detect file transfer finished Check twice before you click! This email originated from outside PNNL. Hi, I've a directory that is watched for the event write-close. When I get this event I assume that the file is received totally. Is it correct? What is the behavior of openssh when a transfer failed? ( Server side ). Micka, _______________________________________________ openssh-unix-dev mailing list openssh-unix-dev at mindrot.org https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.mindrot.org%2Fmailman%2Flistinfo%2Fopenssh-unix-dev&data=04%7C01%7CKevin.Fox%40pnnl.gov%7C6b854f0256c9479e8cb208d89658cb50%7Cd6faa5f90ae240338c0130048a38deeb%7C0%7C0%7C637424655407773492%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=lE%2BPTzUvvEIEVbL%2F93%2FS5%2FnjMEl%2F8KZuPnEbwNV%2F5Qg%3D&reserved=0
On 02.12.20 01:21, Micka wrote:> I've a directory that is watched for the event write-close. > When I get this event I assume that the file is received totally. > Is it correct?No, an open FD *will* eventually be closed, by the OS when the process terminates if need be. Unless the machine *crashes* in mid-operation, of course ... We do a lot of such transfers, and the (our) gold standard, if possible, is to do an upload-then-rename under client control, with the further processing stages on the server requiring a "non-temp name" match. (Since you didn't specify how exactly you transfer the data: This can be done with sftp and ssh(*), but not scp.) (*) E.g., a la "uuencode tempfile < sourcefile | ssh user at host "uudecode && mv tempfile finalfile", not that I'd *recommend* such an approach ... Regards -- Jochen Bern Systemingenieur Binect GmbH -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3449 bytes Desc: S/MIME Cryptographic Signature URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20201202/b0da51fe/attachment-0001.p7s>