crontab教程
大名鼎鼎的crontab就不用介绍了,直接上干货
Crontab 命令
crontab -e: 编辑 crontab 文件, 如果文件不存在则新建
crontab -l: 列出crontab文件的内容
crontab -r: 删除crontab文件
Crontab 案例每一分钟执行一次 /bin/ls:
1* * * * * /bin/ls
在 12 月内, 每天的早上 6 点到 12 点,每隔 3 个小时 0 分钟执行一次 /usr/bin/backup:
10 6-12/3 * 12 * /usr/bin/backup
周一到周五每天下午 5:00 寄一封信给 alex@domain.name:
10 17 * * 1-5 mail -s "hi" alex@domain.name < /tmp/maildata
每月每天 ...