List subdirectories only n level deep on the remote server when use the -a option of rsync.

Paul Slootman paul+rsync at wurtel.net
Tue Feb 4 04:57:04 MST 2014


On Sun 02 Feb 2014, Hongyi Zhao wrote:
> 
> But I've tried the following methodes based on your suggestion and get
> different results:
> 
> ------------
> werner at debian:~$ rsync -a --exclude '/*/*/*/*'
> rsync://ftp.cn.debian.org/debian | wc -l
> 1798
> werner at debian:~$ rsync -a --exclude '/*/*/*/**'
> rsync://ftp.cn.debian.org/debian | wc -l
> 1798
> werner at debian:~$ rsync -a --exclude '/*/*/*/***'
> rsync://ftp.cn.debian.org/debian | wc -l
> 1631
> ------------
> 
> As you can see, the first two give same results, but the third, i.e.,
> the one you gives, give a different result.   Why does this happen?

>From the manpage:

    * a trailing "dir_name/***" will match both the directory (as if
      "dir_name/" had been specified) and everything in the directory
      (as if "dir_name/**"  had been  specified).  This behavior was
      added in version 2.6.7.


Paul


More information about the rsync mailing list