System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

rsync specified directories (include/exclude pattern rules)

 
support_billa
Valued Contributor

rsync specified directories (include/exclude pattern rules)

hello,

 

i try to copy with rsync  a specified directory and the according folders and files below.

 

cd /tmp

 

my version ( not correct, because i match other directories) :

/usr/bin/rsync  -ravz -e ssh --include='*/' --include='*/00/*/*' --exclude='*' .  remote_host:/tmp

 

i want to copy in these example the directory "00" and the according folders and files below.

 

the structure of the directories are :

000001
000001/00
000001/00/dir1
000001/00/dir1/file1
000001/00/dir1/file2
000001/00/dir2
000001/00/dir2/file1
000001/00/dir2/file2
000001/00/dir3
000001/01
000001/01/dir1
000001/01/dir1/file1
000001/01/dir1/file2
000001/01/dir2
000001/01/dir2/file1
000001/01/dir2/file2
000001/01/dir3


000002
000002/00
000002/00/dir1
000002/00/dir1/file1
000002/00/dir1/file2
000002/00/dir2
000002/00/dir2/file1
000002/00/dir2/file2
000002/00/dir3
000002/01
000002/01/dir1
000002/01/dir1/file1
000002/01/dir1/file2
000002/01/dir2
000002/01/dir2/file1
000002/01/dir2/file2
000002/01/dir3

regards,