Gentoo Archives: gentoo-user

From: Kfir Lavi <lavi.kfir@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] rsync include exclude of regex conundrum
Date: Thu, 24 Mar 2011 13:26:04
Message-Id: AANLkTinhuNZiyAXv-nJ+6baoE=k-MsTVTnrME0bTnY0w@mail.gmail.com
1 Hi,
2 I want to rsync all the directories and files that contain the date
3 "2011.03.03".
4 Everything else should not be copied.
5 I did a lot of experiments and read web pages, but can't solve this
6 conundrum.
7
8 kfir@goofy /tmp/rsync.test $ find
9 .
10 ./b
11 ./a
12 ./a/aaa
13 ./a/aaa/2011.03.03
14 ./a/2011.03.04
15 ./a/2011.03.03
16 kfir@goofy /tmp/rsync.test $ rsync -avvn --include "*" --include
17 "**2011.03.03**" --exclude "*" a/ b/
18 sending incremental file list
19 [sender] showing directory aaa because of pattern *
20 [sender] showing directory 2011.03.04 because of pattern *
21 [sender] showing directory 2011.03.03 because of pattern *
22 [sender] showing file aaa/2011.03.03 because of pattern *
23 delta-transmission disabled for local transfer or --whole-file
24 ./
25 2011.03.03/
26 2011.03.04/
27 aaa/
28 aaa/2011.03.03
29 total: matches=0  hash_hits=0  false_alarms=0 data=0
30
31 sent 135 bytes  received 30 bytes  330.00 bytes/sec
32 total size is 0  speedup is 0.00 (DRY RUN)
33
34 kfir@goofy /tmp/rsync.test $ rsync -av  --include "2011.03.03"  a b -v
35 sending incremental file list
36 [sender] showing directory a/2011.03.03 because of pattern 2011.03.03
37 [sender] showing file a/aaa/2011.03.03 because of pattern 2011.03.03
38 delta-transmission disabled for local transfer or --whole-file
39 a/
40 a/2011.03.03/
41 a/2011.03.04/
42 a/aaa/
43 a/aaa/2011.03.03
44            0 100%    0.00kB/s    0:00:00 (xfer#1, to-check=0/5)
45 total: matches=0  hash_hits=0  false_alarms=0 data=0
46
47 sent 179 bytes  received 47 bytes  452.00 bytes/sec
48 total size is 0  speedup is 0.00
49
50 kfir@goofy /tmp/rsync.test $ rsync -avvn --include "*" --include
51 "**2011.03.03**" --exclude "*" a b
52 sending incremental file list
53 [sender] showing directory a because of pattern *
54 [sender] showing directory a/aaa because of pattern *
55 [sender] showing directory a/2011.03.04 because of pattern *
56 [sender] showing directory a/2011.03.03 because of pattern *
57 [sender] showing file a/aaa/2011.03.03 because of pattern *
58 delta-transmission disabled for local transfer or --whole-file
59 a/aaa/2011.03.03 is uptodate
60 total: matches=0  hash_hits=0  false_alarms=0 data=0
61
62 sent 143 bytes  received 31 bytes  348.00 bytes/sec
63 total size is 0  speedup is 0.00 (DRY RUN)
64
65 kfir@goofy /tmp/rsync.test $ rsync -avvn --include "*/" --include
66 "**2011.03.03**" --exclude "*" a b
67 sending incremental file list
68 [sender] showing directory a because of pattern */
69 [sender] showing directory a/aaa because of pattern */
70 [sender] showing directory a/2011.03.04 because of pattern */
71 [sender] showing directory a/2011.03.03 because of pattern */
72 [sender] showing file a/aaa/2011.03.03 because of pattern **2011.03.03**
73 delta-transmission disabled for local transfer or --whole-file
74 a/aaa/2011.03.03 is uptodate
75 total: matches=0 hash_hits=0 false_alarms=0 data=0
76
77 sent 143 bytes received 31 bytes 348.00 bytes/sec
78 total size is 0 speedup is 0.00 (DRY RUN)
79
80
81 Hope it is solvable.
82 Regards,
83 Kfir

Replies

Subject Author
[gentoo-user] Re: rsync include exclude of regex conundrum Kfir Lavi <lavi.kfir@×××××.com>