On Wed, Oct 25, 2000 at 12:49:40PM +0100, Donatella Rossetti wrote:
> I'm using rsync to copy a directory from a local host to remote host
> with the following command:
>
> rsync -av --exclude=“/home/httpd/html/stat” /home/httpd/html
> remotehost:/home/httpd
>
> I would like to exclude from the copy the direcotory
> "/home/httpd/html/stat" but I have not been able to exclude it.
> I have tried all the following commands, but the rsync continue to copy
> the directory as well:
> rsync -av --exclude "/home/httpd/html/stat" /home/httpd/html
> remotehost:/home/html
> rsync -av --exclude="/home/httpd/html/stat/*" /home/httpd/html
> remotehost:/home/html
> rsync -av --exclude "/home/httpd/html/stat/*" /home/httpd/html
> remotehost:/home/html
> rsync -av --exclude-from=/exclude /home/httpd/html
> remotehost:/home/html
>
> where /exclude is a file containing the following line:
> /home/httpd/html/stat
>
> Could someone tell me the right command to exclude the directory “stat”
> from the copy?
Try --exclude "/html/stat/".
The path that rsync's exclude algorithm sees when the source path is a
directory that doesn't end in "/" begins with the basename of the source
path.
- Dave Dykstra