Help us understand the problem. What is going on with this article?

Cronにてエラーを見たいときPostFixを使ってみよう

More than 1 year has passed since last update.

cronで何か実行したときエラーが見れない。
そういう時いかんせん。

解法

apt install postfix

postfixを入れればいい。公開する必要はないので、途中の質問でLocal Onlyを選べばよろしい。

エラーの見方

 cat /var/mail/root

rootでなくても、適宜ユーザー名で。

From root@localhost  Wed Oct 31 06:25:05 2018
Return-Path: <root@localhost>
X-Original-To: root
Delivered-To: root@localhost
Received: by localhost (Postfix, from userid 0)
    id aaaaaa; Wed, 31 Oct 2018 06:25:05 +0000 (UTC)
From: root@localhost (Cron Daemon)
To: root@localhost
Subject: Cron <root@localhost> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>
Message-Id: <aaaa.aaaaa@localhost>
Date: Wed, 31 Oct 2018 06:25:05 +0000 (UTC)

/etc/cron.daily/logrotate:
error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/*log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

何かあるならば、最終行にエラーが表示されます。

Ref

https://askubuntu.com/questions/222512/cron-info-no-mta-installed-discarding-output-error-in-the-syslog

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした