3

I'm uploading a file via rsync from my local machine to a server so that a colleague can download it to his machine. Normally I would notify him to start downloading when the upload is complete, but is there some combination of commands that would allow him to begin downloading while I am still uploading, and then resume after my upload is finished to get the complete file? I'd like to do this for individual files and for directories if possible.

2
  • Doesn't rsync already do this by default? How is your colleague downloading the file?
    – derobert
    Sep 10, 2012 at 14:00
  • See my comment to Rqomey.
    – joebolte
    Sep 10, 2012 at 14:11

1 Answer 1

2

Rsync creates a temporary file called .filename.$$$$ If your friend wants to download while uploading they should download this file using the -P extension, as once you finished, the file will disappear, and he may have to resume the download using the correct filename

I just tested this with rsync and you can download that temp file while you are uploading it. A little bit messy, but it works!

2
  • 1
    By default, rsync writes data to a temporary file, and then copies the file to the correct location when the file is complete, so I don't think it's as simple as -P.
    – joebolte
    Sep 10, 2012 at 14:11
  • @joebolte Indeed I am wrong, the rsync has to be cancelled before the file is created, I have updated my answer with a workaround
    – Rqomey
    Sep 10, 2012 at 16:34

You must log in to answer this question.

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