1

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?

4

rsync --existing will do the trick.

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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