I'm trying to get rsync to exclude the directory "/home/www/users/ftp/pub/" from being copied in the command line below and have not been successful. I've tried many combinations, such as dropping the /'s and adding *'s, without any luck. /home/www/users/ftp/pub/ is not part of a symlink, but it is linked to several times within /home. The local and remote machines are both running rsync 2.5.7 under openbsd 3.4. /usr/local/bin/rsync -zqrlptgo --delete --exclude "/home/www/users/ftp/pub/" root@gorgimera:/home/ /home/backup/gorgimera/home/ What am I doing wrong? Any help would be *greatly* appreciated. -Brian
On Mon, Jan 26, 2004 at 09:21:39PM -0600, Brian Camp wrote:> I'm trying to get rsync to exclude the directory > "/home/www/users/ftp/pub/" from being copied in the command line below > and have not been successful. I've tried many combinations, such as > dropping the /'s and adding *'s, without any luck. > /home/www/users/ftp/pub/ is not part of a symlink, but it is linked to > several times within /home. The local and remote machines are both > running rsync 2.5.7 under openbsd 3.4. > > /usr/local/bin/rsync -zqrlptgo --delete --exclude > "/home/www/users/ftp/pub/" root@gorgimera:/home/ > /home/backup/gorgimera/home/ > > What am I doing wrong? Any help would be *greatly* appreciated.To quote tha manpage (EXCLUDE PATTERNS) The filenames matched against the exclude/include patterns are relative to the destination directory, or "top direc? tory", so patterns should not include the path elements of the source or destination directories. The only way in which a pattern will match the absolute path of a file or directory is if the source path is the root directory. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt
On Mon, Jan 26, 2004 at 09:21:39PM -0600, Brian Camp wrote:> I'm trying to get rsync to exclude the directory > "/home/www/users/ftp/pub/" from being copied in the command line below > and have not been successful.The important part of the man page on this is that exclusions are relative to the base of the transfer, not the root of the filesystem. An easy rule of thumb is that you should exclude the name you see when using the -v option (with a prefixed '/' added). I.e.: rsync -zqrlptgo --delete --exclude=/www/users/ftp/pub/ root@gorgimera:/home/ /home/backup/gorgimera/home/ ..wayne..
Here's another example. An exclude file containing + /mnt/ - /mnt/** will include the directory /mnt but exclude its contents. rgds, tim. Brian Camp wrote:> I'm trying to get rsync to exclude the directory > "/home/www/users/ftp/pub/" from being copied in the command line below > and have not been successful. I've tried many combinations, such as > dropping the /'s and adding *'s, without any luck. > /home/www/users/ftp/pub/ is not part of a symlink, but it is linked to > several times within /home. The local and remote machines are both > running rsync 2.5.7 under openbsd 3.4. > > /usr/local/bin/rsync -zqrlptgo --delete --exclude > "/home/www/users/ftp/pub/" root@gorgimera:/home/ > /home/backup/gorgimera/home/ > > What am I doing wrong? Any help would be *greatly* appreciated. > > -Brian >