I want to rSync some files / folders but i have problems with filters. This is what my source FS looks like:
.
|_ Invent/
| |+ Comps/
| |+ Prod/
| |_ Other/
|_ Archive/
| |_ Comps/
| |_ Prod/
| |_ Other/
|+ Comps.csv
As you've noticed, I want to sync 2 dirs and 1 file. I also want to save the dir&file structure:
./Invent/Comps/*
./Invent/Prod/*
./Comps.csv
I've tried the following command:
rsync -avze "ssh -i key_file"
--include "Comps.csv"
--include "/Invent/Comp/*"
--include "/Invent/Prod/*"
--exclude "*"
/source/path/ rsync@srv:/target/path/
As a result i've got a lot of trash files even not from /source/path/. What is wrong?