【发布时间】:2021-06-27 07:53:42
【问题描述】:
我有一个尝试通过 crontab 运行的 Lua 脚本 - 请参阅下面的请求/计划。
# m h dom mon dow command
0 8 * * * /usr/bin/lua /home/pi/shared/TS_cabin_graph_watts_12h.lua >/home/pi/shared/watts.log 2>&1
1 8 * * * /usr/bin/lua /home/pi/shared/TS_cabin_graph_temp_12h.lua >/home/pi/shared/temp.log 2>&1
整个脚本做了很多不同的事情,但下面是具体的 os.execute 图请求。
print("Start : graph command")
local x = os.execute('graph /home/pi/shared/feed12hr.csv -y 9,10 --ylabel Temp --title CabinTemp --figsize 1600x1000 --output /home/pi/shared/cabingraph12hr.png')
print(x)
print("End : graph command")
当我自己在命令行手动运行它时,它工作正常 - 请参阅下面的输出。
Start : graph command
/usr/local/lib/python2.7/dist-packages/pandas/plotting/_converter.py:129: FutureWarning: Using an implicitly registered datetime converter for a matplotlib plotting method. The converter was registered by pandas on import. Future versions of pandas will require you to explicitly register matplotlib converters.
To register the converters:
>>> from pandas.plotting import register_matplotlib_converters
>>> register_matplotlib_converters()
warnings.warn(msg, FutureWarning)
0
End : graph command
但是当我通过 cronjob 运行后检查日志时,它失败并报告以下内容
Part 4
Start : graph command
32512
End : graph command
知道原因和需要的解决方法吗?
【问题讨论】: