微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

我在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定义为在周日的午夜运行.

原文地址:https://www.jb51.cc/linux/399240.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐