“日”和“日”有什么区别?和“工作日”在启动 StartCalendarInterval 中?
我正在使用 launchd 来运行一些自动化任务,我想知道“日”和“工作日”之间有什么区别。
根据 http://discussions.apple.com/thread.jspa?threadID=1361809 有一个“微妙”的差异可能导致 launchd 行为不当。
最终,我希望有一个每个工作日(周一至周五)上午 8 点运行的 plist,但我不知道如何获得相当于以下内容的 cron
0 8 * * 1-5
I'm working with launchd to run some automated tasks, and I was wondering what the difference is between 'Day' and 'Weekday'.
According to http://discussions.apple.com/thread.jspa?threadID=1361809 there is a 'subtle' difference that can cause launchd to misbehave.
Ultimately, I'd like to have a plist that runs every weekday (Mon - Fri) at 8am, but I don't know how to get the cron equivalent of
0 8 * * 1-5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Day 是该月中的第几天。
Weekday 是一周中的哪一天(0 和 7 == 星期日)。
对于你来说,你需要:
不像 cron 那么优雅......
Day is the day of the month.
Weekday is the day of the week (0 and 7 == Sunday).
For you, you need:
Not quite as elegant as cron...
也试试这个。为我工作!
try this too. Working for me!
您也应该能够使用连字符来指定范围:
不过我没有对此进行测试。 (来源:http://www.launchd.info/)
You should be able to use hyphens to specify ranges as well:
I didn't test this though. (Source: http://www.launchd.info/)