I would like to use rsync to download specific files from a server, here are the scheme of the directory:
.
file1
fakeotherfolder
filefile
morefile
morefakefolder
file
file2
file3
mainfolder
myfolder1
folfile1
folfile2
myfolder2
folfile1
folfile2
myfolder3
folfile1
folfile2
myfolder4
folfile1
folfile2
Basically I would like to get ALL the files that are NOT in a mainfolder/myfolder*
except the specific mainfolder/myfolder2
for exemple.
What I want at the end:
.
file1
fakefolder
filefile
morefile
morefakefolder
file
file2
file3
mainfolder
myfolder2
folfile1
folfile2
I tried rsync with the following options:
rsync --include="*/mainfolder/myfolder2/*" --exclude="*/mainfolder/*"
but what I get is an empty mainfolder...
.
file1
fakefolder
filefile
morefile
morefakefolder
file
file2
file3
mainfolder