How to exclude multiple directories with rsync?

Freedom_Ben

I am trying to backup my home directory using rsync, and I want to exclude some of the directories that contain junk. I want to specifically exclude /home/ben/.ccache and /home/ben/build. Unfortunately the documentation for rsync was information overload and didn't answer my question. This is what I tried:

rsync -arv --exclude "/home/ben/.ccache:/home/ben/build" /home/ben /media/ben/thumbdrive/

What is the right way to do this?

Freedom_Ben

OK I feel really dumb. Before I even posted this question my friend showed me how to do it and it is really simple. To exclude multiple directories you just use multiple --exclude=path switches. So my command above properly written is as follows:

rsync -arv --exclude=.ccache --exclude=build /home/ben /media/ben/thumbdrive/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to exclude multiple directories with rsync?

From Dev

How to exclude numeric directories with rsync?

From Dev

How to exclude numeric directories with rsync?

From Dev

rsync using shopt globstar and **/. - how to exclude directories?

From Dev

rsync: how to exclude directories with special character via external exclude file

From Dev

How can I exclude .* directories from rsync but include the .vnc directory?

From Dev

rsync can't exclude directories

From Dev

How to use rsync command exclude multiple folder

From Dev

How to exclude multiple directories with Exuberant ctags?

From Dev

How to exclude multiple directories from bee pack

From Dev

RSYNC : exclude multiple files

From Dev

rsync multiple files to multiple directories

From Dev

Exclude directories with 'rsync' and ssh with pull request

From Dev

How to exclude files in rsync?

From Dev

How to exclude files in rsync?

From Dev

Rsync to multiple directories with one command?

From Dev

Rsync multiple directories in one line

From Dev

grep: How to exclude directories?

From Dev

How to exclude multiple directories that match a glob pattern in "grep -R"?

From Dev

How to move multiple directories, but exclude files in current path with similar name?

From Dev

How to exclude a folder from rsync

From Dev

How to exclude a folder from rsync

From Dev

rsync: how to exclude the topmost directory

From Dev

How to exclude subdirectory from rsync?

From Dev

How to exclude a folder from rsync

From Dev

How to exclude directories with TAR on OSX?

From Dev

How to include / exclude directories in duplicity

From Dev

How to exclude NFS directories with find?

From Dev

How to properly exclude directories in find?

Related Related

HotTag

Archive