Next: nncp-file, Previous: nncp-daemon, Up: Commands
$ nncp-exec [options] [-use-tmp] [-nocompress] NODE 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
.
If -use-tmp option is specified, then stdin
data is read
into temporary file first, requiring twice more disk space, but no
memory requirements. Same temporary file rules
applies as with nncp-file - command.
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.