Next: , Previous: , Up: Commands  


nncp-exec

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

Send execution command to NODE for specified HANDLE. Body is read from stdin (either into memory, or into encrypted temporary file if -use-tmp is specified) 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.