Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was curious if anyone knew how to setup a rsync job that would only backup certain directories within a certain partition?
For instance, I have a partition on my linux server that has about 15 directories in out. I want to run a rsync backup job that will only backup certain directories on it...
I know this can be done using include/exclude, but im having a little trouble figuring it out...
How about specifying them in a file and using, as you say "exclude".
From the man page:
--exclude-from=FILE exclude patterns listed in FILE
Try a small directory as a test, excluding a subdirectory. Just the the directory in the file to "specify" it. If that does not work, repost what you tried, what you expected, and what you got.
After doing reading and testing, this is what I found.
Obviously, include is set by default. So it will automatically grab everything.
What I did was create a script and put all the direcotires I wanted not to be backed up in there. I also had the incorrect syntax in the file...instead of the full path, it should be:
Glad you got it licked :-) Sometimes the man pages only make sense after one knows the information they provide. For example, as you discovered about the behaviour of include is stated succinctly in the manpages thus:
So an include works only to negate an exclude. The EXCLUDE OPTIONS section is interesting: one can build some quite complicated formulas for backup/copying. You have inspired me to try some things out, thanx.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.