0

I would like to remotely perform an operation upon a file after an rsync transfer like so:

rsync [options] file dest && ssh dest some_program file

This requires the file not to be opened anymore on the receiver side. Is there any guarantee that the receiver side of an rsync tranfer does not exit after the sender process has already finished? I did not find any information about the protocol-fluff around the transfer.

1 Answer 1

1

As soon as rsync is done all files are closed. You should have no problem running that line.

4
  • So there is really no way that the rsync server (that had been forked on the remote side) is still active (e.g. due to waiting for drive i/o) after the sender finished? I read around here but this case is not clear to me.
    – Suuuehgi
    Nov 28, 2019 at 14:17
  • 1
    The file, on remote side, could be still in the cache, waiting to be flushed to disk, or in the write cache of the device, but that doesn't make a difference. But your ssh will get it from there. I don't know how critical your work is, if you really, really want to make sure you could check yourself the file is the same, for example checking the md5 hash on both sides and running flush. And only then run the script. But it's overkill. Nov 28, 2019 at 14:27
  • Thank you! I'll think about the flushing. Btw. I think you meant sync, not flush.
    – Suuuehgi
    Nov 28, 2019 at 14:32
  • Yes, sorry, you're right, that's what I meant. Nov 28, 2019 at 14:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .