简体   繁体   English

OSX中的“ at”破了吗?

[英]Is 'at' broken in OSX?

'at' is a UNIX/BSD/Linux programming tool I use in scheduling some operational forecasting models. “ at”是我用于计划一些运营预测模型的UNIX / BSD / Linux编程工具。 In testing some of my scripts on my Mac laptop, I found that the at tool accepted job submissions without error, and reported them in queue, but ultimately did not execute them. 在Mac笔记本电脑上测试我的一些脚本时,我发现at工具无误地接受了作业提交,并在队列中报告了它们,但最终没有执行它们。

Searching for useful answers for the at tool is difficult because of the common-as-dirt name. 由于at -dirt名称,很难为at工具寻找有用的答案。 However, I saw is crontab broken on OSX El Capitan? 但是,我看到crontab在OSX El Capitan上坏了吗? while trying to solve this problem. 同时尝试解决此问题。

$ at now + one minute
echo "hello world" |say
^D
$ atq  # list at jobs...
7   Mon Mar 13 14:31:00 2017
$

No, but it is disabled by default. 否,但默认情况下处于禁用状态。 See man at and man atrun for details. 有关详细信息,请参见man atman atrun Darwin based systems use launchd rather than init to invoke programs like crond and atrun . 基于Darwin的系统使用launchd而不是init来调用crondatrun类的程序。

Start atrun with 开始atrun

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist

Or enable it for future bootups by modifying /System/Library/LaunchDaemons/com.apple.atrun.plist to have: 或通过将/System/Library/LaunchDaemons/com.apple.atrun.plist修改为具有以下/System/Library/LaunchDaemons/com.apple.atrun.plist来启用它以供将来启动:

...
<key>Enabled</key>
...

On Mojave, it is also necessary to add /usr/libexec/atrun to the Full Disk Access list in OS X's Security and Privacy settings. 在Mojave上,还必须将/ usr / libexec / atrun添加到OS X的“安全性和隐私”设置中的“全盘访问”列表中。 See discussion and instructions here: Making “at” work on macOS 请参阅此处的讨论和说明: 在macOS上使“ at”工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM