使用启动D(MAC)自动运行一次Python脚本
我试图每3天自动运行python脚本。
我要完成的工作是,该脚本是安排每3天的时间安排的,如果当时计算机离线,则应使用启动立即运行 ,然后在下一个计划的时间再次运行。如果我没记错的话?
您知道如何将此特定条件设置为启动脚本吗?
startInterval 似乎不是正确的解决方案。
<key>StartInterval</key>
<integer>600</integer>
先感谢您!
I am trying to automatically run a python script every 3 days.
What I am trying to accomplish is that the script is scheduled for every 3 days and if at that time the computer is offline, the job should be run immediately with startup and then again at the next scheduled time. Launchd does not seem to permit this, at least not directly, if I am not mistaken.
Do you know how to set this specific condition into a launchd script?
StartInterval seems not to be the correct solution.
<key>StartInterval</key>
<integer>600</integer>
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用SHED模块进行此任务的工作方式: https://docs.python.org/3/library/sched.html?adlt = strict&amp;
use the shed module for this task heres how it works: https://docs.python.org/3/library/sched.html?adlt=strict&toWww=1&redig=61A9A3C2EE904C8390C83AFB4AF75D87