Hi, I'm sorry if this is a dumb question, but I have tried millions of combinations of settings. Is it possible to somehow combine --files-from and --filter into one file, so that I can use one here-document? Using the + directive in --filter seems to always give me slightly different results. What I do now is without --files-from, but it means the directory tree is not recreated on the backup server. It just results in /backup/etc /backup/bin and /backup/sbin, which is not what I need. rsync -a -e ssh --compress --numeric-ids --modify-window=1--timeout=600 --fuzzy -v --link-dest="/backup/client1/linux/2006-08-24 11.31.40" --filter='. -' root@client1:' /etc /usr/local/bin /usr/local/sbin ' '/backup/client1/linux/2006-08-24 18.29.05' << EOF . /etc/backup.d/filters/default . /etc/backup.d/filters/default.linux - mrtg - adjtime - random_seed EOF What I want is the effect that --files-from gives in that I can simply copy client1:/ to /backup/ and then only include /etc /usr/local/bin and /usr/local/sbin. Having to use files-from and filter seperately would force me to use a temporary file instead of neatly packed into one command line with a here-document. Sounds like an easy thing to do with a + filter, but I haven't figured it out yet. Thanks Jannes Faber -------------- next part -------------- HTML attachment scrubbed and removed
On 8/24/06, Jannes Faber <j.faber@elevate.nl> wrote:> Is it possible to somehow combine --files-from and --filter into one file, > so that I can use one here-document?In bash you can use multiple here-documents, like this: rsync <blah> --filter='. -' <<ENDFILTERS --files-from=/dev/fd/3 3<<ENDFILES + foo - bar ENDFILTERS file1 path/to/file2 ENDFILES Does that solve the problem? Matt
On Thu, Aug 24, 2006 at 06:45:19PM +0200, Jannes Faber wrote:> Is it possible to somehow combine --files-from and --filter into one file, > so that I can use one here-document?No, but as long as you don't have a huge number of --files-from lines, you can just turn them into command-line args and get the same effect. For instance, this command, given an input of "foo/one" and "bar/two": rsync -av --files-from=list.txt /src /dest is entirely the same as this command (note absense of -r and presence of -R, and use of embedded /./ dir): rsync -RlptgoDv /src/./foo/one /src/./bar/two /dest The use of /./ requires a very recent rsync (at least 2.6.7). Older rsync versions require a chdir instead, perhaps in a sub-shell: (cd /src && rsync -RlptgoDv foo/one bar/two /dest) ..wayne..
Seemingly Similar Threads
- has this been asked about before ? multilple exclude files
- Passwordless SSH messes with escaped spaces
- wondershaper + htb prio + qdisc prio
- Joining Samba4 to Win 2008 AD domain breaks other kerberos functions
- Joining Samba4 to Win 2008 AD domain breaks other kerberos functions