0

I'm trying to use rsync to copy a directory recursively, and copying symlinks referent. I also want to exclude certain directories that are located within the symlink. This is the part that's not working.

I'm using the following command:

rsync -aPL source/ dest/ --exclude source/dir/symlink/node_modules

Directory structure:

.
|-dir
|---symlink
|-----another_dir
|-----node_modules

Unfortunately, it is still copying the node_modules directory, even though I'm trying to exclude it. Any idea how to do this, if possible?

1 Answer 1

0

I just realised I don't have to specify the full directory in the exclude, and if I just exclude the node_modules directory by it's name, it works perfectly:

 rsync -aPL source/ dest/ --exclude node_modules

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .