rsync – 从标准input

尝试在目标上使用以下模板的一些rsyncs:

rsync --daemon --port=7000 --config=$REALLY_SIMPLE_FILE 

然后在src上运行这个:

 rsync -aHPv --port=7000 /some/directory dst::$CONFIG_NAME 

有可能使rsync从标准input读取configuration文件(在dst)? 或者将其作为某种string传递,以至于我不必实际写入文件?

这是不可能的,因为当rsync作为一个守护进程运行时,它将为每个连接分配一个新的进程,每一个这样的进程将再次读取configuration文件。 换句话说,即使文件在STDIN上传递并由父进程读取,第一个孩子也没有什么可读的。

自己validation一下。

 $ rsync --daemon --port=7000 --config=simplefile $ cat simplefile [test1] path=. ... $ rsync rsync://localhost:7000/ test1 $ sed -i -es/test1/test2/ simplefile $ cat simplefile [test2] path=. $ rsync rsync://localhost:7000/ test2 

你可以创build一个命名pipe道,并有一个进程在一个循环中写入configuration给它,但是这同样糟糕,可以说写入文件或者写入FIFO是同样的事情。