[Gllug] Rsync - was Re: cp command

Julian Somers lists at bigpip.com
Wed Nov 29 15:21:32 UTC 2006


On 10:16 Wed 29 Nov     , Andrew Black wrote:
> Stuart Sears wrote:
> 
> >rsync -avP dir/ destination-dir
> >Will copy the *contents* of dir/ to destination-dir.
> 
> Thanks for that. I have used rsync to good effect.
> One thing that has alluded me is the  --include=PATTERN  (and 
> --include-from=FILE) options.
> 
> What iam trying to do is copy a subset of dirs to a parallet tree elsewhere
> /dir/somedir/...            -> /backpuplocation/somedir/...
> /dir/some/other/deepdir/... -> /backpuplocation/some/other/deepdir/...
> 
> I have tried so many combinations of --include and --exclude that I am 
> confused.  Anyone go a sampel of this.

rsync -az -e ssh \
--exclude 'rdiff-backup-data/' \
--exclude '/restore/' \
sprat:/var/backup/ /storage/backup/sprat/

Rsync exclude options are similar to those of GNU tar. 

I remember having trouble with it until I realised it is matching
patterns, not paths. So excluding '/restore/' in the example above will
exclude any directory called restore:
	/this/restore/
	/and/that/restore/
not only 
	/restore/

Julian

> 
> 
> -- 
> Gllug mailing list  -  Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
> 

-- 

Julian Somers
+44 208 265 5407
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list