简体   繁体   中英

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

Tried following entries in crontab with no success!!

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

Any ideas?

You need to have a Mail Transfer Agent (MTA) like Postfix installed and set up. Cron tries to send any output through it as email. It could be that there's some output still coming out of shuf , or that Cron just wants and MTA in order to function.

Once installed (not sure which distro you're using), you should be able to start it (assuming a systemd setup) with:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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