Linux的各种定时任务(计划任务)

Linux内置了功能强悍的任务调度功能,可能过简单的配置来实现较为复杂的调度功能。

编辑任务

 crontab -e

查看任务

crontab -l

每晚的21:30

30 21 * * * /usr/local/etc/rc.d/lighttpd restart

每月1、10、22日的4 : 45

45 4 1,10,22 * * /usr/local/etc/rc.d/lighttpd restart

每周六、周日的1 : 10

10 1 * * 6,0 /usr/local/etc/rc.d/lighttpd restart

每天18 : 00至23 : 00之间每隔30分钟

0,30 18-23 * * * /usr/local/etc/rc.d/lighttpd restart

每星期六的11 : 00 pm

0 23 * * 6 /usr/local/etc/rc.d/lighttpd restart

每一小时

* */1 * * * /usr/local/etc/rc.d/lighttpd restart

晚上11点到早上7点之间,每隔一小时

* 23-7/1 * * * /usr/local/etc/rc.d/lighttpd restart

每月的4号与每周一到周三的11点

0 11 4 * mon-wed /usr/local/etc/rc.d/lighttpd restart

一月一号的4点

0 4 1 jan * /usr/local/etc/rc.d/lighttpd restart

邮件目录

/var/spool/mail/root

猜你喜欢

转载自blog.csdn.net/lpw_cn/article/details/84626886