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?
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?
rsync --existing
will do the trick.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 yourDst
folder, and then runrsync --files-from=:/path/to/files_to_be_synced
, then only the files infiles_to_be_synced
will be transfered.Note the colon ( : ) in command
rsync --files-from=:/path/to/files_to_be_synced
. It means read thefiles_to_be_synced
file from remote server. You can alsa read the file from local server by omit the colon.