Personal computing discussed

Moderators: renee, SecretSquirrel, notfred

 
Crayon Shin Chan
Minister of Gerbil Affairs
Topic Author
Posts: 2313
Joined: Fri Sep 06, 2002 11:14 am
Location: Malaysia
Contact:

rsyncd.conf exclude examples please

Sun Nov 28, 2010 1:19 pm

I'm trying to exclude some directories from being shared on the rsync --daemon side, not the client side. And there are annoyingly no examples of how to do so online. I've tried:
exclude="taiwan 2009"+"Gantz" because I read somewhere that you can only have 1 exclude statement but you can use + or something
exclude="/mnt/samba/blablabla/taiwan 2009/***+/mnt/samba/..../Gantz/***" supposedly the *** is recursive , should be recursive from the start anyway
And a lot more which I haven't typed out because I'm hungry. Any examples please? The manpages should really include examples, saying "excludes files according to a pattern" doesn't help at all.
Mothership: FX-8350, 12GB DDR3, M5A99X EVO, MSI GTX 1070 Sea Hawk, Crucial MX500 500GB
Supply ship: [email protected], 12GB DDR3, M4A88TD-V EVO/USB3
Corsair: Thinkpad X230
 
zamb
Gerbil
Posts: 15
Joined: Wed Nov 26, 2008 9:38 am

Re: rsyncd.conf exclude examples please

Sun Nov 28, 2010 2:25 pm

(I never used “rsyncd”, so be warned…)

You’re, most likely, better off using “exclude from” rule and putting everything in that file. For example:
[path_to_share]
path = /mnt/samba/path_to_share
exclude from = /var/lib/rsyncd/my_exclude_rules

in “/var/lib/rsyncd/my_exclude_rules” you have something like:
- /mnt/samba/path_to_share/secret_dir/***
- /mnt/samba/path_to_share/another_private_dir/***

Note the minus sign followed by a space at the beginning!

If this didn’t work, try using a relative, instead of absolute, path names. In other words, try:
- secret_dir/***
- another_private_dir/***


Please read the sections “FILTER RULES” and “INCLUDE/EXCLUDE PATTERN RULES” in the manual of “rsync”.

Also pay attention to the “-F” option. I think it’s better suited for your needs.

As I said in the above, I never used “rsyncd”, so everything here is theoretical.

Hope that helps.
Ziyad.
 
notfred
Maximum Gerbil
Posts: 4610
Joined: Tue Aug 10, 2004 10:10 am
Location: Ottawa, Canada

Re: rsyncd.conf exclude examples please

Sun Nov 28, 2010 3:09 pm

Here's an rsyncd.conf from one of my machines that I use for doing backups:
[backup]
path = /
exclude = /tmp /var/log /var/spool/apt-mirror /var/spool/squid
read-only
uid = 0
gid = 0

Who is online

Users browsing this forum: No registered users and 1 guest
GZIP: On