Src folder: A.txt B.txt C.txt Dst folder: B.txt

Is there any way to let rsync only sync files in destination folder? So if A and B in source folder updated, rsync only copy B to destination folder?

link|improve this question

feedback

2 Answers

up vote 3 down vote accepted

rsync --existing will do the trick.

link|improve this answer
feedback

You can also try --files-from option which gives you more flexibility in controling what files would be transfered.

In your example, you can run find >/path/to/files_to_be_synced in your Dst folder, and then run rsync --files-from=:/path/to/files_to_be_synced, then only the files in files_to_be_synced will be transfered.

Note the colon ( : ) in command rsync --files-from=:/path/to/files_to_be_synced. It means read the files_to_be_synced file from remote server. You can alsa read the file from local server by omit the colon.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.