How to check if launchd has started the script?

谁说我不能喝 提交于 2019-11-30 03:03:31

You defined StartCalendarInterval, so the job has been executed when it was loaded and it will be executed every day at 18:00.

Query launchd(8) to find out its exit status:

launchctl list | grep mytask

this will return a line line this:

<pid> <status> mytask

When pid is a number, the job is currently running. Otherwise have a look at status, which is the exit code of the program, node in your case. An exit code of 0 means either that the program was finished successfully or that is has not been started yet. Positive numbers are returned for program errors, while negative ones mean that the job has terminated due to a signal.

I assume the job failed. You may want to check the programs standard output/error. Specify StandardOutPath and StandardErrorPath to do that. The content of these files will likely tell you why the program failed.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!