可知对于Centos6每日的计划任务不在crontab里定义
实际定义位置是anacrontab
[root@Test-slave ~]# cat /etc/anacrontab
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=45
# the jobs will be started during the following hours only
START_HOURS_RANGE=3-22
#period in days delay in minutes job-identifier command
1 5 cron.daily nice run-parts /etc/cron.daily
7 25 cron.weekly nice run-parts /etc/cron.weekly
@monthly 45 cron.monthly nice run-parts /etc/cron.monthly
[root@Test-slave ~]#
它的意义是:每一天的3点到22点期间随机延时45分钟+5分钟,执行/etc/cron.daily中的任务,通知给root (此处只对daily work进行解释,其它类推)
然后我们看看/etc/cron.daily下的内容
[root@Test-slave ~]# ll /etc/cron.daily
total 28
-rwx------. 1 root root 118 Oct 15 23:33 cups
-rwxr-xr-x. 1 root root 196 Jul 18 2013 logrotate
-rwxr-xr-x. 1 root root 905 Feb 22 2013 makewhatis.cron
-rwxr-xr-x. 1 root root 174 Sep 24 2012 mlocate.cron
-rwxr-xr-x. 1 root root 2126 Jul 19 2013 prelink
-rwxr-xr-x. 1 root root 563 Nov 23 2013 readahead.cron
-rwxr-xr-x. 1 root root 365 Oct 16 2009 tmpwatch
[root@Test-slave ~]#
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。