I tried to use the
--filter option in rsync but I was a bit baffled
by the syntax and the manpage is nice but I couldn't understand. I wanted
certain directories completely, other directories default excluded and
certain files in one directory but not all. After some trail and error
and talking to the teddybear:
rsync -rvv --progress /home/koos/rsyncsource/ /home/koos/rsyncdest --filter='merge /home/koos/rsyncfilter'
And in the filter file name things to include and exclude:
+ /wel/
- /niet/
+ /random/file
- /random/*
And the result is what I want:
$ ~/bin/testrsync
building file list ...
[sender] showing directory wel because of pattern /wel/
[sender] hiding directory niet because of pattern /niet/
[sender] hiding file random/niet because of pattern /random/*
[sender] showing file random/file because of pattern /random/file
7 files to consider
delta-transmission disabled for local transfer or --whole-file
random/
random/file
0 100% 0.00kB/s 0:00:00 (xfer#1, to-check=4/7)
wel/
wel/file1
0 100% 0.00kB/s 0:00:00 (xfer#2, to-check=2/7)
wel/file2
0 100% 0.00kB/s 0:00:00 (xfer#3, to-check=1/7)
wel/file4
0 100% 0.00kB/s 0:00:00 (xfer#4, to-check=0/7)
total: matches=0 hash_hits=0 false_alarms=0 data=0
sent 319 bytes received 126 bytes 890.00 bytes/sec
total size is 0 speedup is 0.00
Now to do this on a filesystem with 151000 files.