Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Attempting some rsyncs with the following template on the destination:

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

and then running this on the src:

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

is it possible to make rsync read the configuration file(on the dst) from stdin? or to pass it as some sort of string such that i dont have to actually write a file?

share|improve this question
add comment

1 Answer

It is not possible, because when running rsync as a daemon, it will fork a new process for every connection and every such process will read the config file again. In other words, even if the file is passed on STDIN and read by the parent process, the first child will have nothing to read.

Verify it yourself.

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

You could make a named pipe and have a process write the config to it in a loop, but this is just as bad and arguably writing a file or writing to a fifo is the same thing.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.