Using rsync to syncronize folder structure with file filter

I used this command to sync a folder structure with rsync in combination with a file filter:

[code language=”bash” light=”true”] rsync -avz –include ‘*/’ –include ‘**/HERE_THE_PATTERN’ –exclude=’*’ DIR_TO_SYNC REMOTEHOST:TARGETDIR
[/code]

For a dry-run, you could add the -n parameter to the call above:

[code language=”bash” light=”true”] rsync -anvz –include ‘*/’ –include ‘**/HERE_THE_PATTERN’ –exclude=’*’ DIR_TO_SYNC REMOTEHOST:TARGETDIR
[/code]

Leave a Reply

This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.