【Ubuntu】cronのログを/var/log/cron.logへ出力させる方法Ubuntu Server 20.04でcronのログを/var/log/cron.logへ出力させる方法です。rsyslogの設定変更Ubuntu Server 20.04の初期設定では、rsyslogでcronの実行ログを/var/lo...
(最終行を追加)
# This file has been deprecated. Please add custom options for cron using
# $ systemctl edit cron.service
# or
# $ systemctl edit --full cron.service
EXTRA_OPTS='-L 15' #追加
May 14 21:00:01 ubuntu CRON[23196]: (root) CMD ([23197] <<実行コマンド>>)
May 14 21:00:10 ubuntu CRON[23196]: (CRON) error (grandchild #23197 failed with exit status 1)
May 14 21:00:10 ubuntu CRON[23196]: (root) MAIL (mailed 1495 bytes of output but got status 0x004b from MTA#012)
May 14 21:00:10 ubuntu CRON[23196]: (root) END ([23197] <<実行コマンド>>)