Share your knowledge at the LQ Wiki.
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, 08:17 PM   #1
Registered: Mar 2005
Location: Burnaby, BC, Canada
Distribution: Slackware 14 32bit, Debian, Arch
Posts: 226

Rep: Reputation: 29
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-26-2010, 11:40 PM   #2
Slackware Contributor
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 227Reputation: 227Reputation: 227
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 10:54 AM
What files to exclude when using rsync TongueTied Linux - General 2 07-20-2006 08:39 PM
can't get rsync exclude files Batta Linux - Newbie 1 03-27-2006 10:39 PM
copy 3 files to a directory and all subdirectories? snip128 Linux - Newbie 9 08-12-2005 09:18 PM
Copying all files from subdirectories into one directory Hegemon Linux - General 3 01-17-2005 11:25 AM

All times are GMT -5. The time now is 01:12 PM.

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