定时任务crond、crontab
crontab命令是用来设置定时任务规则的配置命令,配置文件/etc/crontab 与/var/spool/cron/目录下当前用户名的文件。 -l 显示当前定时任务 -e 编辑定时任务 对于root用户: crontab -l 等同于 cat /var/spool/cron/root crontab -e 等同于 vim /var/spool/cron/root crond.service服务管理 要想配置定时任务,首先启动crond服务。 systemctl start crond.service systemctl stop crond.service systemctl status crond.service 开启自启动: systemctl disable crond.service systemctl enable crond.service /etc/crontab 配置问价介绍: [root@55test /etc]# cat /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