rsync : how to exclude specific files or folders ?
Vincent Trouilliez
vincent.trouilliez at modulonet.fr
Sat Feb 28 23:07:11 UTC 2009
On Sat, 28 Feb 2009 17:22:15 -0500
Hal Burgiss <hal at burgiss.net> wrote:
> This is my solution. And yes the syntax is onery. Use rsync with the
> -F option. It think will use a .rsync-filter file. I place this in /,
> but I backup most of the system. By default everything is included, so
> I do simple exclusions. Some examples, that work for me:
>
> - /mnt/media
>
> - /var/tmp/*
> - /var/cache/*
> - */_htdocs/
> - */logs/*
>
> The '*' is a wildcard and will ignore a directory named _htdocs
> anywhere it finds one.
>
> There are other ways to use filters, but I found this and it works. So
> something like this should work:
>
> - /home/vincent/.VirtualBox
> - /home/vincent/.googleearth
Oh ! After reading your mail, and re-re-re-reading the man page, I ventured into this:
$rsync <options> --exclude '*.VirtualBox' --exclude '*.googleearth' <source> <destination>
and it worked ! It didn't backup the directories, yeehaa !! :-)
So it was possible to do it directly from the command line then, without a filter file, cool :-)
--
Vince, happy chappy...
More information about the ubuntu-users
mailing list