Enable crontab logging in ubuntu and solve the problem of No MTA installed and discarding output.

Source: Internet
Author: User
Tags rsyslog

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.