如何设置cron在未来的特定时间只运行一次文件? [英] How to setup cron to run a file just once at a specific time in future?
问题描述
如何设置cron在未来的特定时间只运行一次文件?其中一个选择是 http://en.wikipedia.org/wiki/At_%28Unix%29 但到目前为止,所有用户都无法访问标准托管计划。因此,我想知道是否有办法使用 cron
?
How to setup cron to run a file just once at a specific time in future? One of the alternatives is http://en.wikipedia.org/wiki/At_%28Unix%29 but it is by far not accessible to all users on standard hosting plans. Therefore I was wondering whether there is way to do it using cron
?
推荐答案
请于2011年3月30日午夜执行命令:
Try this out to execute a command on 30th March 2011 at midnight:
0 0 30 3 ? 2011 /command
警告:如注释中所述,年列在cron的标准/默认实施中不受支持。请参考下面的TomOnTime答案,以便在将来在cron的标准实现中的特定时间运行脚本的正确方法。
WARNING: As noted in comments, the year column is not supported in standard/default implementations of cron. Please refer to TomOnTime answer below, for a proper way to run a script at a specific time in the future in standard implementations of cron.
这篇关于如何设置cron在未来的特定时间只运行一次文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!