【发布时间】:2016-04-24 08:55:38
【问题描述】:
我的 macbook 中有一个使用 mac osx El Capitan 的 cronjob(每 10 分钟截屏一次),它执行以下命令:
*/10 * * * * cd /Users/userx/Pictures/memes && ./shared.sh
shared.sh 脚本包含以下内容:
#!/bin/bash
_now=$(date +"%m_%d_%Y_%H_%M_%S")
screencapture -x $_now.png
但是当系统执行 cronjob 我得到这个错误:
./shared.sh: line 3: screencapture: command not found
但如果我直接在终端中运行 shared.sh 文件,一切都会正确执行。
有什么想法吗??我们可以从 cronjobs 运行 mac osx 命令吗??
【问题讨论】:
标签: macos unix terminal crontab