背景:購買的阿里雲主機磁盤容量過小,不小心一下子頂滿了。
刪除一些東西后發現能正常使用,然后寫個定時任務腳本,發現/var/log/cron 為空。其他的除開頂滿外的日期之前有輸入,其余都為空。
度娘半天,看盡各位大佬扯淡,終於在谷歌看到一篇文章解決問題。
$ vi /etc/rsyslog.conf
找到此行:#$ModLoad imklog # reads kernel messages (the same are read from journald)
修改為:$ModLoad imklog # reads kernel messages (the same are read from journald)
找到此行:$OmitLocalLogging on
修改為:#$OmitLocalLogging on
找到此行:$IMJournalStateFile imjournal.state
修改為:#$IMJournalStateFile imjournal.state
重啟日志服務:systemctl restart rsyslog
tail -f /var/log/cron 發現有輸入信息了