简体   繁体   English

shuf -n1 text.txt> test.csv未安装MTA,丢弃输出

[英]shuf -n1 text.txt > test.csv No MTA installed, discarding output

I would like to copy each hour via cron each hour one line out of text.txt to text.csv 我想每一个小时通过cron每小时一行复制出来的text.txt来text.csv

Tried following entries in crontab with no success!! 尝试以下没有成功的crontab项!

0 * * * *  shuf -n1 Zitate.txt > Zitat.csv >/dev/null 2>&1
0 * * * *  shuf -n1 Zitate.txt > Zitat.csv

syslog returning - No MTA installed, discarding output 系统日志返回 - 未安装MTA,丢弃输出

Any ideas? 有任何想法吗?

You need to have a Mail Transfer Agent (MTA) like Postfix installed and set up. 您需要安装和设置Postfix之类的邮件传输代理(MTA)。 Cron tries to send any output through it as email. Cron尝试通过它发送任何输出作为电子邮件。 It could be that there's some output still coming out of shuf , or that Cron just wants and MTA in order to function. 可能是shuf仍然有一些输出,或者Cron只是想要MTA才能正常工作。

Once installed (not sure which distro you're using), you should be able to start it (assuming a systemd setup) with: 安装后(不确定使用的发行版),您应该能够使用以下命令启动它(假设使用systemd设置):

% sudo systemctl start postfix
% sudo systemctl enable postfix  # start on subsequent boots

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM