I'm trying to Rsync my Laravel project and this is how my filter.txt looks like:

+ app/
+ config/
+ database/
+ public/
+ resources/
+ routes/
- .env
- */

And I run rsync with these options: rsync -vzcrSLhp

The problem is if there is changed file, say in the "resources/views/" subdirectory for example, the rsync does not detect that.

How can I make it traverse all subdirectories and include everything (every depth) ?

Second question: I have my filter.txt in the current directory so I run rsync like this:

rsync -vzcrSLhp filter=". filter.txt"

Is there a way so I can put my filter file in another directory and reference to that? right now it's in code/project/ and I move it to code/

I tried filter="../ filter.txt" but it doesn't work.


Alright I figured that out myself.

I should have used a lead / before the directory names. Also had to change */ to /*/

+ /app/
+ /config/
+ /database/
+ /public/
+ /resources/
+ /routes/
- .env
- /*/

And my second question is solved too. using --filter=". ../filter.txt"

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.