yum install crontabs
systemctl enable crond
systemctl start crond
vi /etc/crontab
从左到右分别是 分钟(0~59)、小时(0~23)、天(1~31)、月(1~12)、星期(0~6)、用户名、要执行的命令或者脚本。
59 23 * * * root /home/backup/showdoc/backup.sh
crontab /etc/crontab 保存任务后才能生效
crontab -l 查看任务
0 */2 * * * root hdparm -y /dev/sdb
0 */2 * * * 每间两个小时执行一次