Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

@haniokasai

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

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

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
2
Help us understand the problem. What are the problem?