每9天从Cron启动脚本

发布于 2025-01-23 06:25:26 字数 410 浏览 2 评论 0原文

我看到了一些问题,涉及每天开始启动cron。但是我无法理解一些逻辑步骤的工作方式。

我需要每9天启动一次cron,以获取一个脚本(发送给电子邮件),每10天(服务器电源),然后每14天(发送通用电子邮件)和每15天(删除服务器)。

如果您能帮助我理解逻辑,它是如何工作的,我会很高兴。

For example, how to set cron job for every 45 days:

10 13 * * * test $((date +%s/24/60/60\%45 )) = 41 & ;& your_script,但我可以理解我应该在情况下更改什么? 45至9?45至10?

您能提供建议吗?

I saw some questions hire, about how start cron every n-days. But I can not understand some logical steps how it works.

I need to start cron every 9 days for one script (send notofication to email), every 10 days for others (poweroff the server), then every 14 days (send notofication email) and every 15 days (delete the server).

If you could help me understand logical, how it works, I would be glad.

For example, how to set cron job for every 45 days:

10 13 * * * test $((date +%s/24/60/60\%45 )) = 41 && your_script but I can understand what I should to change to use in my case? 45 to 9?, 45 to 10?

Could you please help with advice?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

注定孤独终老 2025-01-30 06:25:26

建议阅读有关cron调度

另外,您可以练习调度配置在这里

Suggesting to read more about cron scheduling here.

Also you can practice the scheduling configuration here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文