加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 知道在cron每周运行之前剩下多少时间?

发布时间:2020-12-13 17:03:40 所属栏目:Linux 来源:网络整理
导读:我在debian 6. 有什么方法可以看看在每周开始之前剩下多少天? 解决方法 系统crontab通常在/ etc / crontab /中定义.在这里定义了cron.weekly,cron.daily等的时间间隔.我的/ etc / crontab /看起来像: SHELL=/bin/shPATH=/usr/local/sbin:/usr/local/bin:/s
我在debian 6.

有什么方法可以看看在每周开始之前剩下多少天?

解决方法

系统crontab通常在/ etc / crontab /中定义.在这里定义了cron.weekly,cron.daily等的时间间隔.我的/ etc / crontab /看起来像:
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user command
 17 * *   *   *   root cd / && run-parts --report /etc/cron.hourly
 25 6 *   *   *   root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
 47 6 *   *   7   root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
 52 6 1   *   *   root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )

所以我的cron.weekly会在一周的第7天6:47运行.

编辑:
以上信息仅适用于/etc/cron.weekly目录中的脚本.正如Iain所指出的那样,@ weekly定义为在周日的午夜运行.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读