wildcards and nested files

Kevin Korb kmk at sanitarium.net
Tue Jul 2 12:32:58 MDT 2013

Hash: SHA1

No, that is a consequence of using a * on the command line.  The shell
would expand "/home/*/.maildir" to a list of all matching paths.  When
you delete a user their /home/username will no longer exist so that
pattern will no longer match and their directory will not be on the
command line.  Therefore rsync will not be operating on that directory
on the target therefore it won't be deleted.

The exclude-from example I just sent in another email will not have
this problem.

On 07/02/13 14:30, Grant wrote:
>> I forgot the --delete.  Also, note that it will not delete an
>> entire account that you have deleted from the source as /home/*
>> will no longer match them.
> You're saying if I rsync /home/user and then delete /home/user
> from the source and rsync again with --delete, it won't delete
> /home/user from the destination?  Is there a workaround for that?
> I'd like to keep the source and destination in sync.
> - 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/*/*
>>>> - 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.
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


More information about the rsync mailing list