查看crontab 任务执行情况
1.查看/var/log/cron
[root@xynev-p-mysql-salve-19 spool]# cat /var/log/cron |more Dec 1 03:25:01 VM000002646 run-parts(/etc/cron.daily)[33211]: finished logrotate Dec 1 03:25:01 VM000002646 run-parts(/etc/cron.daily)[33193]: starting man-db.cron Dec 1 03:25:01 VM000002646 run-parts(/etc/cron.daily)[33222]: finished man-db.cron Dec 1 03:25:01 VM000002646 run-parts(/etc/cron.daily)[33193]: starting mlocate Dec 1 03:25:01 VM000002646 run-parts(/etc/cron.daily)[33233]: finished mlocate Dec 1 03:25:01 VM000002646 anacron[27993]: Job `cron.daily' terminated Dec 1 03:25:01 VM000002646 anacron[27993]: Normal exit (1 job run) Dec 1 03:30:01 VM000002646 CROND[34327]: (root) CMD (/usr/lib64/sa/sa1 1 1) Dec 1 03:40:01 VM000002646 CROND[36477]: (root) CMD (/usr/lib64/sa/sa1 1 1) Dec 1 03:50:01 VM000002646 CROND[38658]: (root) CMD (/usr/lib64/sa/sa1 1 1) Dec 1 04:00:01 VM000002646 CROND[40808]: (root) CMD (/usr/lib64/sa/sa1 1 1) Dec 1 04:01:01 VM000002646 CROND[41033]: (root) CMD (run-parts /etc/cron.hourly) Dec 1 04:01:01 VM000002646 run-parts(/etc/cron.hourly)[41033]: starting 0anacron Dec 1 04:01:01 VM000002646 run-parts(/etc/cron.hourly)[41042]: finished 0anacron Dec 1 04:10:01 VM000002646 CROND[43002]: (root) CMD (/usr/lib64/sa/sa1 1 1) Dec 1 04:20:01 VM000002646 CROND[45153]: (root) CMD (/usr/lib64/sa/sa1 1 1) Dec 1 04:30:01 VM000002646 CROND[47334]: (root) CMD (/usr/lib64/sa/sa1 1 1) Dec 1 04:40:01 VM000002646 CROND[49533]: (root) CMD (/usr/lib64/sa/sa1 1 1) Dec 1 04:50:01 VM000002646 CROND[51683]: (root) CMD (/usr/lib64/sa/sa1 1 1) Dec 1 05:00:01 VM000002646 CROND[53850]: (root) CMD (/usr/lib64/sa/sa1 1 1) Dec 1 05:01:01 VM000002646 CROND[54075]: (root) CMD (run-parts /etc/cron.hourly) Dec 1 05:01:01 VM000002646 run-parts(/etc/cron.hourly)[54075]: starting 0anacron Dec 1 05:01:01 VM000002646 run-parts(/etc/cron.hourly)[54084]: finished 0anacron
2.查看/var/spool/mail/root
[root@xynev-p-mysql-salve-19 ~]# cat /var/spool/mail/root From root@VM000002646.localdomain Fri Dec 13 02:00:41 2019 Return-Path: <root@VM000002646.localdomain> X-Original-To: root Delivered-To: root@VM000002646.localdomain Received: by VM000002646.localdomain (Postfix, from userid 0) id 49C071BF831; Fri, 13 Dec 2019 02:00:41 +0800 (CST) From: "(Cron Daemon)" <root@VM000002646.localdomain> To: root@VM000002646.localdomain Subject: Cron <root@VM000002646> /root/scripts/mysql_back.sh Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated Precedence: bulk X-Cron-Env: <XDG_SESSION_ID=62> X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/0> X-Cron-Env: <LANG=en_US.UTF-8> X-Cron-Env: <SHELL=/bin/sh> X-Cron-Env: <HOME=/root> X-Cron-Env: <PATH=/usr/bin:/bin> X-Cron-Env: <LOGNAME=root> X-Cron-Env: <USER=root> Message-Id: <20191212180041.49C071BF831@VM000002646.localdomain> Date: Fri, 13 Dec 2019 02:00:01 +0800 (CST)