一、查看定时任务是否开启
[root@VM_0_11_centos cron.d]# pgrep cron
1185
[root@VM_0_11_centos cron.d]# ps -ef | grep -i cron | grep -v grep
root 1185 1 0 23:44 ? 00:00:00 /usr/sbin/crond -n
[root@VM_0_11_centos cron.d]#
二、开启关闭定时任务
[root@VM_0_11_centos cron.d]# systemctl stop crond
[root@VM_0_11_centos cron.d]# pgrep crond
[root@VM_0_11_centos cron.d]# systemctl start crond
[root@VM_0_11_centos cron.d]# pgrep crond
4323
[root@VM_0_11_centos cron.d]# systemctl restart crond
[root@VM_0_11_centos cron.d]# pgrep crond
4380
[root@VM_0_11_centos cron.d]#
三、相关配置文件
1、/etc/crontab文件
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23