發現/var/log下沒有cron的日誌怎麼辦?

1,修改rsyslog文件:

[ruby] view plain copy
  1. /etc/rsyslog.d/50-default.conf  

將  rsyslog  文件中的  #cron.*  前的  #  刪掉;


2,重啓rsyslog服務:

[ruby] view plain copy
  1. service rsyslog restart  

3,重啓cron服務:

[ruby] view plain copy
  1. service cron restart  

4,查看日誌文件:

[ruby] view plain copy
  1. tail -f /var/log/cron.log  


其實,Ubuntu中,cron的日誌是存在的:

By default the cron log in ubuntu is located at /var/log/syslog. Use the below command to check the cron entries in this file.

grep cron /var/log/syslog


只需執行:

[ruby] view plain copy
  1. grep cron /var/log/syslog  
發佈了55 篇原創文章 · 獲贊 31 · 訪問量 19萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章