Quote:
Originally Posted by digiot
Since this has come around a couple of times without response, I'll pitch in and say maybe you should restate your problem. First, it works for me - as near as I can figure.
|
Thanks for the response. As a repeatable example, try this:
Code:
mkdir /tmp/rsynctest
touch !$/file1
mkdir ~/rtest
cd ~/rtest
mkdir source
mkdir dest
ln -s /tmp/ source/
ls -l source/ <shows the link in source to /tmp>
cd dest/
rsync -rptgoDLKv --include="*rsynctest*" ../source/ .
<notice - everything copied>
Quote:
Second, if you want to rsync '$source/foo/bar/1920x1080', then why not do 'rsync -avz $source/foo/bar/1920x1080 $dest'?
|
because 1920x1080 may exist in more than one place. While I could go in and find where it exists as a pre-process, I'd rather use the power rsync gives me by only including certain files.
Quote:
And when you say "it's still grabbing everything", what is 'everything'? Everything in $source?
|
Yes, it's grabbing files/directories that do not match "1920", therefore the include is not working - at least in the example where there are lots of symbolic links.
Quote:
And here the ground opens up: 'I don't want to use a filter rules file as the include will eventually come from user input.' So this is part of an interactive script for hapless users? Information about that would probably be important.
|
I don't see why this is incredibly important, but yes, this is a script. It's meant for non-linux types that need to transfer data from a file server to their local machine. They run it by typing "localize 1920x1080" or "localize 640x486" or "localize some_thing"
Quote:
I'm not sure I can help because, while I swear by rsync and use it religiously, I just figured out what I wanted to do and put it in a script so I wouldn't have to think about it much again.
|
Well, thanks for the reply if nothing else. I use rsync all the time as well - just don't often use includes & even less often have to follow symlinks outside of the rsync'd tree.