wildcards and nested files

Kevin Korb kmk at sanitarium.net
Tue Jul 2 13:31:22 MDT 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/02/13 15:25, Grant wrote:
>> Anyways, the other way to do what you are asking is: rsync -azvi
>> --exclude-from=excludes.txt --delete --delete-excluded / 
>> user at hostname:
>> 
>> excludes.txt: + / + /etc + /etc/** + /home + /home/*/ +
>> /home/*/.maildir/ + /home/*/.maildir/** - - *
> 
> So the includes are in excludes.txt prefixed with "+ " and the 
> excludes are prefixed with "- - "?

I am not sure where the second - came from.  That line should have
been "- *" as in exclude everything that I didn't explicitly include
previously (order matters).  I find it much easier to list both in a
single file rather than using two since order is so important.
Especially if you have multiple sets of includes and excludes.

> 
> If I want to rsync the /var/lib/portage/world file I should add
> the following to excludes.txt?
> 
> + /var + /var/lib + /var/lib/portage + /var/lib/portage/world

Correct.  Before the - *

> Also I think --delete-excluded implies --delete.

It probably does.  I didn't look.

I also added a -i (--itemize-changes) because I am trying to generate
a habit of always pairing it with -v since -v isn't all that useful
without it.

> - Grant
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
	Kevin Korb			Phone:    (407) 252-6853
	Systems Administrator		Internet:
	FutureQuest, Inc.		Kevin at FutureQuest.net  (work)
	Orlando, Florida		kmk at sanitarium.net (personal)
	Web page:			http://www.sanitarium.net/
	PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlHTKooACgkQVKC1jlbQAQdSsQCgiqdqCIobVXrs8Za2da+fHSGW
4WEAoLmPcbePDdnmUj+bS/2USGGmgZMf
=my30
-----END PGP SIGNATURE-----


More information about the rsync mailing list