Next: , Previous: , Up: Commands   [Index]


nncp-exec

$ nncp-exec [options] [-use-tmp] [-nocompress]      NODE HANDLE [ARG0 ARG1 ...]
$ nncp-exec [options] [-use-tmp] [-nocompress] area:AREA HANDLE [ARG0 ARG1 ...]

Send execution command to NODE for specified HANDLE. Body is read from stdin into memory and compressed (unless -nocompress is specified). After receiving, remote side will execute specified handle command with ARG* appended and decompressed body fed to command’s stdin.

For example, if remote side has following configuration file for your node:

exec: {
  sendmail: [/usr/sbin/sendmail, "-t"]
  appender: ["/bin/sh", "-c", "cat >>/append"]
}

then executing echo My message | nncp-exec -replynice 123 REMOTE
sendmail root@localhost
will lead to execution of:

echo My message |
    NNCP_SELF=REMOTE \
    NNCP_SENDER=OurNodeId \
    NNCP_NICE=123 \
    /usr/sbin/sendmail -t root@localhost

If notification is enabled on the remote side for exec handles, then it will sent simple letter after successful command execution with its output in message body.

Pay attention that packet generated with this command won’t be be chunked.

If you use area:AREA instead of NODE, then multicast packet will be sent to specified area. That creates outgoing packet to the self node, so you have to run tossing to create outgoing packets to required subscribers.