LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-01-2004, 12:39 PM   #1
karlovac
LQ Newbie
 
Registered: Mar 2004
Posts: 25

Rep: Reputation: 15
Using the exclude option absolutely with rsync


I've discovered that any pattern specified for the --exclude option when rsyncing is treated as relative to the source destination, so:

Code:
rsync -azn -e ssh --exclude /foo/ /var/www/html/ me@mysite.com:/var/www/html
... means "exclude /var/www/html/foo/" not exclude "/foo/".

Is there any practical way around this? I have a shell script that builds up an rsync command based on arguments (e.g. "sync the entire website, sync just HTML files etc, sync a user-specified directory, sync just a single user-specified file etc.), but directories to be excluded must be absolutely specified. For example there is a list of directories I never want to sync:

/home/myuser/.ssh
/var/www/html/foo

Clearly my way of building up an rsync command by iterating through the exclude options is no good.

The only other approach I can think of is to always use / as the source, and then have a bunch of absolute exclude options, and one single include option that specifies what to actually sync.

Thanks,

Antun
 
  


Reply



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
wget --exclude-directories option broken? (fc2) fsbooks Fedora 3 06-20-2009 06:08 PM
tar --exclude --exclude-from cefn Linux - Software 4 10-11-2005 07:31 PM
Absolutely no clue tuananhbirm Mandriva 2 06-05-2005 11:48 AM
rsync exclude list steelhead79 Linux - Software 3 01-14-2005 12:10 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:05 PM.

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
Open Source Consulting | Domain Registration