Advanced rsync includes and excludes

Henri Shustak henri.shustak at
Thu Oct 10 03:31:01 UTC 2019


The link above may outline a slightly different approach which may work on your system. However, you would need that approach assumes the backup path is set to root which may not be what you want to do.

For quick inline reference the excludes file example is included below. You should be able to modify this to make it work for you. However, as mentioned you will need to test it out on your system and see if it is doing what you expect.

> /private/etc/ssh_config/
> + private     
> + private/etc/***
> + private/var/***
> + home/***
> - *


> 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
> -- 
> Please use reply-all for most replies to avoid omitting the mailing list.
> To unsubscribe or change options:
> Before posting, read:

More information about the rsync mailing list