Understand include exclude script

Kevin Korb kmk at sanitarium.net
Fri Oct 19 14:45:13 MDT 2012


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

When you use the + and - syntax it doesn't matter if you call it an
- --include-from=file or an --exclude-from=file.  Those only matter if
the list is a plain list of patterns without the + or -.

The only things you excluded are .* Desktop/ and Download/ not
anything like music or video.

By default everything is included.  The list of excludes override that
by removing some things from the list.  The list of includes override
those excludes putting some things back into the list.  So, if you
make a bunch of +/- patterns anything that isn't matched by any of the
patterns will be included.

If you want to reverse that and have only things that you specifically
include be copied then your list needs to end with:
- - *
That will exclude everything that hasn't been previously included.
Note that you will probably also want:
+ */
somewhere near the top.

On 10/19/12 16:34, Marc wrote:
> if i merge this config, i need to put it in include file? i tried
> and it copied all file and folder
> 
> 
> also why in my old script some folder like  music, video and
> document  was copied while i don't wrote to do it?
> 
> 
> 
> 
> ----- Original Message ----- From: Kevin Korb <kmk at sanitarium.net> 
> To: rsync at lists.samba.org Cc: Sent: Friday, October 19, 2012
> 6:18:09 PM Subject: Re: Understand include exclude script
> 
> The - .** and .* lines are both excluding all .files and
> .directories except for the ones you specifically included.  For
> easyness of reading I would suggest you merge the two files
> together with something like:
> 
> + .Skype/*** + .local/ + .local/share/ +
> .local/share/local-mail/*** + .mozilla/*** - .* - Desktop/ -
> Download/
> 
> Though I don't actually suggest excluding .* since there are lots
> of important configuration files that you will be excluding that
> way.
> 
> 
> 
> On 10/19/12 08:28, Marc wrote:
>> hi
> 
>> i use a script to backup my homedir, that work but there are
>> somes things i don't really understand.
> 
>> here my script
> 
>> rsync -arv --delete --prune-empty-dirs
>> --include-from=include.txt --exclude-from=exclude  /home/bob
>> /media/usbkey
> 
>> include.txt file + .Skype/*** + .local/ + .local/share/ + 
>> .local/share/local-mail/*** + .mozilla/*** - .**
> 
>> exclude.txt file Desktop/ Download/ .*
> 
>> I have a lot of folder in my home: music, video, Document.
> 
>> I undersdand  that it script copy skype, local-mail and mozilla 
>> content. -.** means exclude other?
> 
>> and for exlude file: exclude Desktop, Download and .* means all 
>> other?
> 
>> also why music, video and document are copied, is there
>> something in the script who said to copy it?
> 
>> thanks
> 
> 
> 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
	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.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCBu9kACgkQVKC1jlbQAQerZwCfZ+56Q0Hk9NPToUArEsKRApBS
ReAAoKCQvali7HEgy0ZI3SIWyb5p84kO
=Kpyt
-----END PGP SIGNATURE-----


More information about the rsync mailing list