Linux-Crontab定时任务
Last updated
Last updated
crontab [-u username] //省略用户表表示操作当前用户的crontab
-e (编辑工作表)
-l (列出工作表里的命令)
-r (删除工作作)
从左到右依次是分、时、日、月、周五种,操作符有
***** 取值范围内的所有数字
/ 每过多少个数字
- 从X到Z
**,**散列数字
* * * * * myCommand
3,15 * * * * myCommand
3,15 8-11 * * * myCommand
3,15 8-11 */2 * * myCommand
3,15 8-11 * * 1 myCommand
30 21 * * * /etc/init.d/smb restart
45 4 1,10,22 * * /etc/init.d/smb restart
10 1 * * 6,0 /etc/init.d/smb restart
0,30 18-23 * * * /etc/init.d/smb restart
0 23 * * 6 /etc/init.d/smb restart
0 */1 * * * /etc/init.d/smb restart
0 23-7/1 * * * /etc/init.d/smb restart