【问题标题】:script not working when invoked via cron通过 cron 调用时脚本不起作用
【发布时间】:2014-09-18 07:50:45
【问题描述】:

我创建了一个脚本script.sh,其中包含

./ecc start pricingUpdater & >> /home/eceuser/Muthu/details/Latest.txt

ecc 是另一个脚本。

如果我通过简单地调用 ./script.sh 手动运行脚本,我可以启动该实用程序:

Starting Oracle Communication Elastic Charging Controller 11.2.0.1 ...

-- Node 'pricingUpdater' started with PID 10705
^[[1m===>^[[m [{GridEventImpl
status: true
node: PricingUPdater node pricingUpdater on Host 10.180.85.16
details: [pid:10705, state:running]
}]

但如果我尝试通过crontab 运行相同的脚本,我会得到:

Starting Oracle Communication Elastic Charging Controller 11.2.0.1 ...

所以该实用程序没有启动。

【问题讨论】:

  • 您是否在脚本中尝试过 ecc 的完整路径?
  • 我想你的意思是./ecc .. pricingUpdater >> ...Latest.txt &
  • 不,我的意思是像 /this/is/full/path/to/ecc 这样的完整路径
  • 我尝试了全放,但它也不起作用

标签: shell unix cron


【解决方案1】:

您似乎正在使用无权编辑或创建 /home/eceuser/Muthu/details/Latest.txt 文件的用户运行 cron 作业

【讨论】:

    猜你喜欢
    • 2014-10-12
    • 1970-01-01
    • 2014-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-29
    • 2015-05-18
    • 2011-01-07
    相关资源
    最近更新 更多