Re: exclude directory from rsync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 06/08/2015 10:12 PM, Tim Dunphy wrote:
I'm trying to do an rsync of the entire /var directory, but exclude just
the /var/www directory.
...
rsync -avzp --exclude-from=/var/www /var/ /mnt/var/

--exclude-from takes a filename as an argument. That filename is expected to contain a list of patterns to exclude.

rsync -avzp --exclude=/var/www /var/ /mnt/var/

If your exclude pattern begins with '/', then it matches a filename immediately within the transfer root. So in this case, "/var/var/www".

Read the "FILTER RULES" and "INCLUDE/EXCLUDE PATTERN RULES" sections of the manual.

Try:

rsync -avzp --exclude=/www /var/ /mnt/var/

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux