View crontab running logs in Ubuntu

Source: Internet
Author: User
Tags rsyslog
The cause is that a Ubuntu server crontab has failed to regularly run the scp backup script. It is okay to manually execute the script. Therefore, you need to find the cause from the crontab log, suddenly I found that no cron logs exist in my/var/log. Here I will record how to modify tuserver, how to view crontab logs, and how to modify rsyslogsudovim/etc/rsyslog. d/50-default.confcron

Cause

Today, I found that an Ubuntu server crontab failed to regularly run the scp backup script. It is okay to manually execute the script. So I want to find the cause from the crontab log, I suddenly found no cron logs under my/var/log. Here I will record how to view crontab logs on ubuntu server.

Crontab logs

Modify rsyslog

Sudo vim/etc/rsyslog. d/50-default.conf

Cron. */var/log/cron. log # Remove the annotator before cron.

Restart rsyslog

Sudo service rsyslog restart

View crontab logs

Less/var/log/cron. log

Crontab problem locating

View logs

/Var/log/cron. log and/var/mail/$ user

Because the running logs of crontab are recorded in cron. log, the sendmail service will send an email to the current running owner of crontab.

Ssh error message

Solution

Delete the. ssh/hosts file of the current host user.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

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.