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

Re: Excluding folders in rsync command?

On Sun, Jan 15, 2012 at 11:02:00PM +0100, J.A. de Vries wrote:
> > is it possible to exclude directories/folders from a rsync command
> > please? i know you can do files using a wildcard like *.avi, but is it
> > possible to exclude e.g. /home/boztu/videos ?
> You can use the --exclude option if you want to specifiy the directory from the 
> commandline. If you want to do it in a filter file just use the name of the 
> directory and prepend it with a minus. Like so
> + .rsync
> - .rsync/logs
Another thing to keep in mind:  if you end a pattern with a '/' then it
only matches a directory.  For instance,

--exclude something	# matches files, symlinks, directories
--exclude something/	# matches only directories


Reply to: