Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

rsync --existing will do the trick.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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