我执行launchctl start com.xxx.xxx.plist
我可以找到AutoMakeLog.err
内容:
Traceback (most recent call last):
File "/Users/xxxx/Downloads/Kevin/auto.py", line 67, in <module>
output = open(file_name, 'w')
IOError: [Errno 13] Permission denied: '2015-04-22-09:15:40.log'
列表内容:
<array>
<string>/Users/xxxx/Downloads/Kevin/auto.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Minute</key>
<integer>30</integer>
<key>Hour</key>
<integer>08</integer>
</dict>
<key>StandardOutPath</key>
<string>/Users/xxxx/Downloads/Kevin/AutoMakeLog.log</string>
<key>StandardErrorPath</key>
<string>/Users/xxx/Downloads/Kevin/AutoMakeLog.err</string>
自动.sh
#!/bin/sh
/usr/bin/python /Users/xxxx/Downloads/Kevin/auto.py
自动.py
file_name = time.strftime('%Y-%m-%d-%H:%M:%S', time.localtime(time.time()))
file_name += '.log'
output = open(file_name, 'w')
output.writelines(response.text)
output.close()
auto.sh 和 auto.py 有 chomd 777
PS:我直接执行auto.sh没有任何错误。