Start crontab log in Ubuntu


Ubuntu does not turn on cron logging by default
1. Modify rsyslog

$ sudo vim /etc/rsyslog.d/50-default.conf 
Cron. * / var / log / cron. Log # remove the comment before cron

2. Restart rsyslog

$ sudo service rsyslog restart

3. View crontab log

$ less /var/log/cron.log

PS: restart the log service and view the log after the task is executed.

This work adoptsCC agreementReprint must indicate the author and the link of this article