【发布时间】:2016-02-12 08:59:33
【问题描述】:
当我通过命令行运行 python 脚本时,一切正常,但是脚本是从 cron 运行的,ConfigParser 会创建一个空的部分列表
me = singleton.SingleInstance()
######### Accessing the configuration file #######################################
config = ConfigParser.RawConfigParser()
config.read('./matrix.cfg')
sections = config.sections()
######### Build the current map ##################################################
print sections
这是 cron 作业
* * * * * /usr/bin/python /etc/portmatrix/matrix.py |记录器
这是输出
Feb 12 12:59:01 dns01 CRON[30879]: (root) CMD (/usr/bin/python /etc/portmatrix/matrix.py | logger) 2 月 12 日 12:59:01 dns01 记录器:[]
【问题讨论】: