-
For e.g. I want to merge all files from I use this command:
This works... but I'm not sure if that safe. Is it guaranteed that files from the first source will always be in priority?
But will the file from the first source always come first after fsort? P.S. I want to use single rsync command. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Explanation of my case # create test data
$ mkdir overlay/ main/ destination/
$ echo "file from overlay" > overlay/file
$ echo "file from main" > main/file
# rsync files
$ rsync -av --delete overlay/ main/ destination/
sending incremental file list
./
file
sent 168 bytes received 38 bytes 412.00 bytes/sec
total size is 12 speedup is 0.06
# check result
$ cat destination/file
file from overlay |
Beta Was this translation helpful? Give feedback.
-
Also I read this in wiki:
Merge sort (fsort), used in rsync, is an stable sort? |
Beta Was this translation helpful? Give feedback.
-
The flist.c file has comments about this, but I didn't find it mentioned in the manpage. Some of the comments:
So, with identically named files, rsync always chooses the first one encountered. If the second folder has a dir named the same as a file in the first folder, the dir is sent instead. |
Beta Was this translation helpful? Give feedback.
-
Thanks for explanation. Rsync is awesome :) |
Beta Was this translation helpful? Give feedback.
The flist.c file has comments about this, but I didn't find it mentioned in the manpage. Some of the comments:
So, with identically named files, rsync always chooses the first one encountered. If the second folder has a dir named the same as a file i…