Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 12-26-2010, 09:17 PM   #1
Registered: Mar 2005
Location: BC, Canada
Distribution: Slackware 14.2 x64
Posts: 281

Rep: Reputation: 57
Rsync exclude a directory with all subdirectories and files

Just a quick question about rsync.
In reading the rsync man page and browsing a lot of websites, I ended up a bit confused, or maybe it was just too much eggnog .
Anyway, to exclude a directory "videos" with everything in it, which is
and I'm rsyncing the whole user1 directory to an external drive

--exclude /camera/videos /home/user1 /some_external_drive
--exclude /camera/videos/ /home/user1 /some_external_drive
does not exclude the directory videos, which I want to exclude
But when I omit the front slash, it works
--exclude camera/videos /home/user1 /some_external_drive
Now, from the manpage
a trailing "dir_name/***" will match both the directory (as if
"dir_name/" had been specified) and everything in the directory
(as if "dir_name/**" had been specified). This behavior was
added in version 2.6.7
So am I to understand that if I use
--exclude camera/videos/*** /home/user1 /some_external_drive
will work also?
Old 12-27-2010, 12:40 AM   #2
Slackware Contributor
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 229Reputation: 229Reputation: 229
I'd say
The trailing slash should be enough to let rsync know it's a directory.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
help with rsync exclude files Red Squirrel Linux - Software 4 03-03-2009 11:54 AM
What files to exclude when using rsync TongueTied Linux - General 2 07-20-2006 09:39 PM
can't get rsync exclude files Batta Linux - Newbie 1 03-27-2006 11:39 PM
copy 3 files to a directory and all subdirectories? snip128 Linux - Newbie 9 08-12-2005 10:18 PM
Copying all files from subdirectories into one directory Hegemon Linux - General 3 01-17-2005 12:25 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration