I tried to use the --filter option in rs ... / 2010-01-06

2010-01-06 I tried to use the --filter option in rs ... 10 years ago
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.

Tags: , , ,

, reachable as koos+website@idefix.net. PGP encrypted e-mail preferred.

PGP key 5BA9 368B E6F3 34E4 local copy PGP key 5BA9 368B E6F3 34E4 via keyservers pgp key statistics for 0x5BA9368BE6F334E4 Koos van den Hout
RSS
Other webprojects: Camp Wireless, wireless Internet access at campsites, The Virtual Bookcase, book reviews
This page generated in 0.004511 seconds.