1.编辑/etc/rsyslog.d/50-default.conf,去掉 #cron前注释
sudo vim /etc/rsyslog.d/50-default.conf
2.重启rsyslog和cron服务
sudo systemctl restart rsyslog
sudo systemctl restart cron
3.每5秒查看一次cron.log日志
watch tail -n 50 /var/log/cron.log
4. 一键设置脚本
sudo sed -i 's/^#cron/cron/' /etc/rsyslog.d/50-default.conf
sudo systemctl restart rsyslog
sudo systemctl restart cron
watch tail -n 50 /var/log/cron.log