crond需要重启么?

今天一同事说把A机器的/var/spool/cron/admin scp到B机器上的/var/spool/cron/目录下,有时不生效,需要restart crond.

经过实际验证,发现此现象描述不对。为了查明现象,又看了一下cron 的manual page,有这么一段描述:

Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab) has changed, and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted whenever a crontab file is modified. Note that the crontab(1) command updates the modtime of the spool directory whenever it changes a crontab.

因为直接把A机器的/var/spool/cron/admin scp到B机器上的/var/spool/cron目录下,B机器的/var/spool/cron目录modtime肯定会改变.大家知道此目录下的任何文件内容变动都会导致目录的modtime改变。 change time意味着文件属性的变动时间, modification time意味着文件内容的变动时间,如果内容发生变动,change time也会变动。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值