LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 12-26-2010, 09:17 PM   #1
Slackovado
Member
 
Registered: Mar 2005
Location: Burnaby, BC, Canada
Distribution: Slackware 14 32bit, Debian, Arch
Posts: 220

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


Hi,
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
/home/user1/camera/videos
and I'm rsyncing the whole user1 directory to an external drive

Code:
--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
Code:
--exclude camera/videos /home/user1 /some_external_drive
Now, from the manpage
Quote:
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
Code:
--exclude camera/videos/*** /home/user1 /some_external_drive
will work also?
Thanks
 
Old 12-27-2010, 12:40 AM   #2
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 227Reputation: 227Reputation: 227
I'd say
Code:
--exclude='camera/videos/'
The trailing slash should be enough to let rsync know it's a directory.
 
1 members found this post helpful.
  


Reply


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


All times are GMT -5. The time now is 08:45 AM.

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