Advanced rsync includes and excludes

Hans-Peter Jansen hpj at urpla.net
Wed Aug 7 13:54:36 UTC 2019


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





More information about the rsync mailing list