After crontab is installed in ubuntu, crontab logs are disabled by default. How to start crontab logs:
Modify the rsyslog file and delete # before # cron. * in the/etc/rsyslog. d/50-default.conf file;
Restart rsyslog service rsyslog restart;
Restart the cron service cron restart;
The code is as follows: |
Copy code |
More/var/log/cron. log;
|
You can view the running log file. If No MTA installed or discarding output is displayed in the log file
That is to say, the crontab script will not directly output error information, but will be sent to your mailbox in the form of an email. At this time, the mail server is required, if you have not installed the email server, it will report this error. If it is a test, you can use the following method to solve the problem:
Add the following to each scheduled script:
The code is as follows: |
Copy code |
>/Dev/null 2> & 1
|
The problem of No MTA installed and discarding output can be solved.