hexo-deployer-rsync icon indicating copy to clipboard operation
hexo-deployer-rsync copied to clipboard

Can't exclude multiple directories

Open pozitron57 opened this issue 9 years ago • 2 comments

With args: '--exclude=dir1' works fine, dir1 is excluded. How to exclude multiple directories? I tried

args: '--exclude=dir1 --exclude=dir2'
args: '--exclude={dir1,dir2}'
exclude: [dir1, dir2]
exclude: ['dir1', 'dir2']

with no luck. Rsync doesn't exclude anything with these setups.

Well, finally I figured out that it can be done like this:

args: '--exclude-from=list-of-files-to-exclude'

where list-of-files-to-exclude is file where all directories and files to be excluded are listed:

dir1
dir2

pozitron57 avatar Aug 23 '16 14:08 pozitron57

Unfortunately I got the same problem at persent.

xiaosiyu0603 avatar Oct 12 '24 14:10 xiaosiyu0603

Thanks for the tip of --exclude-from.

I suspect some escaping happens when using multiple options, which is treated as a single option --exclude=dir1\ --exclude=dir2 (so the value of --exclude is dir1 --exclude=dir2).

thom4parisot avatar Nov 09 '24 10:11 thom4parisot