Wednesday, 2 October 2019

linux - rsync - does it create a temp file during transfer?


As far as I can see rsync doesn't create the file in the target directory until it is complete.


This must mean that it creates the file in a temp directory somewhere and copies the file into the target directory when it is complete.


First off, is this correct?


If true, is it possible for rsync to set not use a temp directory and instead create the file in the target directory and just keep writing to it until it's complete?



Answer



Yes, it does create a temp file.


According to the man page you can specify the directory in which the temp file is stored with the parameter -T as in



-T, --temp-dir=DIR create temporary files in directory DIR



The answer to the second part of your question can also be found there:



--inplace


This option changes how rsync transfers a file when the file's data needs to be updated: instead of the default method of creating a new copy of the file and moving it into place when it is complete, rsync instead writes the updated data directly to the destination file.



No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...