如何让rsync在一个群中构build一个文件模式?

我有一个rsync命令,我通过cron每小时运行一次,并防止它有多个同时rsyncs(如果下一个小时左右,前一小时的rsync仍在运行)我已经把它包装在一个群中。 我的问题是,尽pipe指定一个排除filter应该防止临时文件被复制,我得到'文件已经消失'的消息输出,似乎表明他们将被复制(如果他们仍然存在)。

这是我的脚本(由cron运行):

#! /bin/sh cd /blah/data flock -n .rsync_lock -c "rsync $1 -xa --exclude '/tmp*' --ignore-existing jcr/datastore remote-host:data/jcr" 

这里是我得到的输出:

 file has vanished: "/blah/data/jcr/datastore/tmp1774058021534447273.tmp" file has vanished: "/blah/data/jcr/datastore/tmp2911761408812578785.tmp" file has vanished: "/blah/data/jcr/datastore/tmp3744586075822519088.tmp" file has vanished: "/blah/data/jcr/datastore/tmp6622502546708007750.tmp" file has vanished: "/blah/data/jcr/datastore/tmp8270853704354349176.tmp" rsync warning: some files vanished before they could be transferred (code 24) at main.c(977) [sender=2.6.9] 

为什么我的排除filter不能阻止这些文件被考虑传输? 这是一个奇怪的bash报价问题?

如果你想排除这些文件,你的排除模式需要是*/tmp*.tmp