Advanced rsync includes and excludes

Kevin Korb kmk at sanitarium.net
Wed Aug 7 15:36:01 UTC 2019


I believe you can shorten that to:

+ /some/very/
+ /some/very/deep/
+ /some/very/deep/path/
+ /some/very/deep/path/to/
+ /some/very/deep/path/to/save/***
- /some/*

You could also exclude /some and then use /some/very/deep/path/to/save
as an additional source.  I don't know if rsnapshot can handle multiple
sources in 1 rsync but rsync itself can.

On 8/7/19 9:54 AM, Hans-Peter Jansen via rsync wrote:
> Hi,
> 
> I'm a happy camper @ rsync (and rsnapshot) since years. Thanks for this major 
> piece of software.
> 
> In an attempt to reorganize my rsnapshot backups, I stumbled across an issue, 
> that I'm trying to seeking a more sophisticated solution here.
> 
> Given, I have a deeply branched tree, where I would like to include a specific 
> directory deep under, while excluding anything else on that path, I find 
> myself doing:
> 
> + /some/
> + /some/very/
> + /some/very/deep/
> + /some/very/deep/path/
> + /some/very/deep/path/to/
> + /some/very/deep/path/to/save/
> - /some/very/deep/path/to/*
> - /some/very/deep/path/*
> - /some/very/deep/*
> - /some/very/*
> - /some/*
> 
> While it works, it feels rather awkward and gets very complicated, if you have 
> more of such items to deal with. Sure, I could run this separately, but this 
> isn't the real McCoy either with a complicated tree structure.
> 
> What are your favorite ways of doing such tasks with rsync?
> 
> Thanks in advance,
> Pete
> 
> 
> 

-- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
	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:			https://sanitarium.net/
	PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/rsync/attachments/20190807/43451104/signature.sig>


More information about the rsync mailing list