wildcards and nested files

Kevin Korb kmk at sanitarium.net
Tue Jul 2 12:30:54 MDT 2013


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

- --files-from is a specific list of files to sync.  It is designed with
the idea of being generated by find.

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/**
- - *

The -R (--relative) in my previous example was a shortcut for two
sources and one target.

On 07/02/13 14:24, Grant wrote:
>> rsync -aRzv /etc /home/*/.maildir rsyncuser at hostname:
> 
> I'd actually like to use --files-from so it's easier to manage and 
> --files-from doesn't support wildcards.  That's why it gets so
> messy.
> 
> - Grant
> 
> 
>>> I'm trying to use wildcards and nested files and I think there
>>> must be a better way than what I'm doing.  If I want to copy
>>> only these two directories:
>>> 
>>> /etc /home/*/.maildir
>>> 
>>> Is this the best way to do it:
>>> 
>>> rsync -arzv --delete-excluded --files-from 'files-from.txt' 
>>> --include-from 'include-from.txt' --exclude-from
>>> 'exclude-from.txt' / rsyncuser at hostname:
>>> 
>>> files-from.txt: /etc
>>> 
>>> include-from.txt: /home /home/* /home/*/.maildir
>>> 
>>> exclude-from.txt: /home/*/*

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
	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/

iEYEARECAAYFAlHTHF0ACgkQVKC1jlbQAQfLiQCeIbZ/u08ZycJQvuwXvVQbu0Lv
H98AoMuMH/pmSStZuGn1M3aaP7eduSDd
=Ukr8
-----END PGP SIGNATURE-----


More information about the rsync mailing list