问题原文
原帖链接 · Joel'-' · CC BY-SA 4.0
I have a command which looks like this:
rsync -avp -e ssh /folder user@server:/backups/2 --link-dest=../1 Folder number increases every day.
This command runs every night, over my very very slow internet connection. If it did not complete during the night, the process will be killed because otherwise my connection is unusable during the day. This would work fine, if Rsync starts with creating hard-links, and then does the data-transfer.
Unfortunately, it looks like Rsync performs its tasks on alphabetical order. So sometimes it starts with transferring data and then afterwards it will create its hard links.
If the process does not complete overnight, it needs to upload even more data the next night, because the hardlinks were not created in folder 2!
Is there a way to make Rsync create the hard links first and then do the filetransfers?
Thanks a lot!
已采纳解答
原帖链接 · Joel'-' · CC BY-SA 4.0
The answer is to add --delay-updates. This causes Rsync to build a list of all changes first. The target will then create all the hard links and create all folders. After that, the datatransfer will start.
rsync -avp --delay-updates -e ssh /folder user@server:/backups/2 --link-dest=../1
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
