我想知道我是否可以让cron.d
执行一个cron命令,这样stdout或stderr上的任何东西都会被重定向到一个运行在同一台机器上的守护进程,等待输入。在这种情况下,它将是标准输出或stderr
的输出。cron输出到一个守护进程
例子:
* * * * * root /path/to/the/script.sh 2>&1 | <daemon process>
我想知道我是否可以让cron.d
执行一个cron命令,这样stdout或stderr上的任何东西都会被重定向到一个运行在同一台机器上的守护进程,等待输入。在这种情况下,它将是标准输出或stderr
的输出。cron输出到一个守护进程
例子:
* * * * * root /path/to/the/script.sh 2>&1 | <daemon process>
什么:
* * * * * /path/to/the/script.sh 2>&1 | /path/to/the/daemon
?
我作出这样的守护进程STDIN
阅读的假设(它不是在您的文章中提到)
如果它是一个守护进程,我不认为这将是这种情况 – hexist
因此OP应该解释守护进程如何处理输入 –
如何守护程序等待输入? TCP/IPC套接字?如果是这样,你可以看看netcat的数据从stdin/stderr到某处的某个套接字。 – hexist