I have searched a little and read the man page but I can't really find a good definite answer to this. Can rsync write to a FIFO? Obviously one needs the --inplace to do this, does one also need --write-devices? It would be very handy if one can do this, to use as a simple message passing mechanism. Write something to a file on system A and rsync it to a FIFO on system B where there is a simple script reading the FIFO. The script gets the contents of the file every time it's written. (this is all within a LAN behind a reasonably secure firewall) -- Chris Green
Chris Green via rsync <rsync at lists.samba.org> (Fr 10 Feb 2023 10:31:15 CET):> Can rsync write to a FIFO? Obviously one needs the --inplace to do > this, does one also need --write-devices?I think, there is no point in using rsync, as there is nothing to compare against on the remote side (and I've doubts if rsync will be happy with a "file" that isn't seekable.) As rsync uses SSH nowadays, I'd do something like scp LOCAL-FILE remote-host:FIFO But, I'm not sure if scp is happy with a FIFO on the remote end. A fallback could be ssh remote-host 'cat >FIFO' <LOCAL-FILE Best regards from Dresden/Germany Viele Gr??e aus Dresden Heiko Schlittermann -- SCHLITTERMANN.de ---------------------------- internet & unix support - Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} - gnupg encrypted messages are welcome --------------- key ID: F69376CE - -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: <http://lists.samba.org/pipermail/rsync/attachments/20230211/a86b5826/signature.sig>
If this helps, in old days I used to use cpio for a similar thing. I do not want to spam you with my whole script, but willing to share if you want. I think you will get the hang of it by the following snippet. (Get yourself man-knowledge about the -i -o -p mechanism of cpio and the use of dd.) This was in the good (?) old days when rsh worked as simple (and insecure) as this. In modern *n*x like systems rsh is a link to ssh, which is (besides being entirely wrong!) a pitfall to finding correct cli arguments. But it is manageable if you are aware of it. CPIOP = parameter arguments to cpio /tmp/$$.f = list of files Snippet: case $CPIOP in -i*) rsh -l $RUSER $RHOST dd if=$RDEV | cpio $CPIOP ;; -o*) cpio $CPIOP </tmp/$$.f | rsh -l $RUSER $RHOST dd of=$RDEV ;; -p) cpio -ocv </tmp/$$.f | rsh -l $RUSER $RHOST cpio -icmd ;; *) echo argument mismatch $CPIOP >&2 exit ;; esac Hope this gives an idea Hardy Am 10.02.23 um 10:31 schrieb Chris Green via rsync:> I have searched a little and read the man page but I can't really find > a good definite answer to this. > > Can rsync write to a FIFO? Obviously one needs the --inplace to do > this, does one also need --write-devices? > > It would be very handy if one can do this, to use as a simple message > passing mechanism. Write something to a file on system A and rsync it > to a FIFO on system B where there is a simple script reading the FIFO. > The script gets the contents of the file every time it's written. > > (this is all within a LAN behind a reasonably secure firewall) >