]> Cypherpunks.ru repositories - nncp.git/blob - doc/cmd/nncp-exec.texi
Streamed NNCPE format
[nncp.git] / doc / cmd / nncp-exec.texi
1 @node nncp-exec
2 @section nncp-exec
3
4 @example
5 $ nncp-exec [options] [-use-tmp] [-nocompress]      NODE HANDLE [ARG0 ARG1 @dots{}]
6 $ nncp-exec [options] [-use-tmp] [-nocompress] area:AREA HANDLE [ARG0 ARG1 @dots{}]
7 @end example
8
9 Send execution command to @option{NODE} for specified @option{HANDLE}.
10 Body is read from @code{stdin} into memory and compressed (unless
11 @option{-nocompress} is specified). After receiving, remote side will
12 execute specified @ref{CfgExec, handle} command with @option{ARG*}
13 appended and decompressed body fed to command's @code{stdin}.
14
15 For example, if remote side has following configuration file for your
16 node:
17
18 @verbatim
19 exec: {
20   sendmail: [/usr/sbin/sendmail, "-t"]
21   appender: ["/bin/sh", "-c", "cat >> /append"]
22 }
23 @end verbatim
24
25 then executing @verb{|echo My message | nncp-exec -replynice 123 REMOTE
26 sendmail root@localhost|} will lead to execution of:
27
28 @example
29 echo My message |
30     NNCP_SELF=REMOTE \
31     NNCP_SENDER=OurNodeId \
32     NNCP_NICE=123 \
33     /usr/sbin/sendmail -t root@@localhost
34 @end example
35
36 If @ref{CfgNotify, notification} is enabled on the remote side for exec
37 handles, then it will sent simple letter after successful command
38 execution with its output in message body.
39
40 @strong{Pay attention} that packet generated with this command won't be
41 be chunked.
42
43 If you use @option{area:AREA} instead of @option{NODE}, then
44 @ref{Multicast, multicast} packet will be sent to specified area. That
45 creates outgoing packet to the @strong{self} node, so you have to run
46 @ref{nncp-toss, tossing} to create outgoing packets to required subscribers.