]> Cypherpunks.ru repositories - nncp.git/blob - doc/cmd/nncp-exec.texi
7eb5e8a7c0b3afe6168c98c2d8d73c42d65e0d72
[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 If @option{-use-tmp} option is specified, then @code{stdin} data is read
16 into temporary file first, requiring twice more disk space, but no
17 memory requirements. @ref{StdinTmpFile, Same temporary file} rules
18 applies as with @ref{nncp-file, nncp-file -} command.
19
20 For example, if remote side has following configuration file for your
21 node:
22
23 @verbatim
24 exec: {
25   sendmail: [/usr/sbin/sendmail, "-t"]
26   appender: ["/bin/sh", "-c", "cat >> /append"]
27 }
28 @end verbatim
29
30 then executing @verb{|echo My message | nncp-exec -replynice 123 REMOTE
31 sendmail root@localhost|} will lead to execution of:
32
33 @example
34 echo My message |
35     NNCP_SELF=REMOTE \
36     NNCP_SENDER=OurNodeId \
37     NNCP_NICE=123 \
38     /usr/sbin/sendmail -t root@@localhost
39 @end example
40
41 If @ref{CfgNotify, notification} is enabled on the remote side for exec
42 handles, then it will sent simple letter after successful command
43 execution with its output in message body.
44
45 @strong{Pay attention} that packet generated with this command won't be
46 be chunked.
47
48 If you use @option{area:AREA} instead of @option{NODE}, then
49 @ref{Multicast, multicast} packet will be sent to specified area. That
50 creates outgoing packet to the @strong{self} node, so you have to run
51 @ref{nncp-toss, tossing} to create outgoing packets to required subscribers.