永远不会执行的 cron 作业 [英] A cron job that will never execute

查看:45
本文介绍了永远不会执行的 cron 作业的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法可以创建一个 cron 表达式来完全不运行作业?

Is there any way to create a cron expression for not running the job at all?

我虽然使用这个表达:

0 0 0 1 1 ?3099

0 0 0 1 1 ? 3099

...实际上可以完成这项工作,因为它将在 3099 年运行,但是有没有更简洁的方法来做到这一点?

...which will practically do the job as it will run on year 3099, but is there a cleaner way to do it?

推荐答案

如果您在遥远的未来仍然在寻找一些强大的东西,请尝试 https://stackoverflow.com/a/13938099/1601531,我建议使用 2 月 31 日 在从不打算执行的 crontab 条目中.

If you're still looking for something robust even in the far future, try https://stackoverflow.com/a/13938099/1601531, where I suggest the use of February 31st in crontab entries which are never intended to execute.

0 0 5 31 2 ?

这篇关于永远不会执行的 cron 作业的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆