Proper --exclude= syntax?

Max Bowsher maxb at
Wed Jan 8 22:54:00 EST 2003

----- Original Message -----
From: "Dan Kressin" <dkressin at>
To: <rsync at>
Sent: Wednesday, January 08, 2003 10:15 PM
Subject: Proper --exclude= syntax?

> I'm currently syncing the home directories on two boxes with the syntax:
> dest-host# rsync -av -e "ssh" --delete --progress source-host:/home/
> That's working well.  Now I want to exclude /home/httpd/* from the
> (I don't want web changes on one box to affect the other box.)  Which of
> following is the best/correct one to use?
> 1) --exclude=/home/httpd/*
> 2) --exclude=/home/httpd/
> 3) --exclude=/home/httpd

Won't work with command above. They refer to /home/home/httpd.

> 4) --exclude=httpd/*

Would sync perms on httpd, but not contents, also, would apply to all dirs
called httpd anywhere in /home/.

> 5) --exclude=httpd/

Would exclude all dirs called httpd anywhere in /home/.

> 6) --exclude=httpd

Would exclude all dirs or files called httpd anywhere in /home/.

I would use --exclude=/httpd/


More information about the rsync mailing list