Re: Can rsync write to a FIFO?

2023-02-11 Thread Robin Lee Powell via rsync
Yeah, I was thinking tar, but it's effectively the same thing.

On Sat, Feb 11, 2023 at 07:14:57PM +0100, Hardy via rsync wrote:
> 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  ;;
>   -p)
> cpio -ocv  ;;
>   *)  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)
> > 
> 
> -- 
> 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

-- 
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


Re: Can rsync write to a FIFO?

2023-02-11 Thread Hardy via rsync

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 &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)



--
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


Re: Can rsync write to a FIFO?

2023-02-11 Thread Heiko Schlittermann via rsync
Chris Green via rsync  (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' 

signature.asc
Description: PGP signature
-- 
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