On Tue, 2009-10-27 at 15:38 -0700, Jacob Weber wrote: > Is it possible to call rsync and tell it to use a filter file if it > exists, but otherwise continue without errors? > > If I pass "--filter=. .rsync-filter", it will fail if .rsync-filter > doesn't exist. > > I know you can pass "--filter=: /.rsync-filter" to search for filter > files in each directory. That won't fail if there aren't any such > files. But I'm only interested in one file at the root.
No, rsync does not have such a feature. It could be added, but I would be skeptical of letting the filter support grow organically into something unmanageable; I'd rather see it replaced with a full scripting language once and for all. For now, you can test for the filter file in the script calling rsync. Here's the syntax for bash: filter_opt=() if [ -e .rsync-filter ]; then filter_opt=("--filter=. .rsync-filter") fi rsync ... "${filter_o...@]}" ... -- Matt -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html