【问题标题】:Cron unable to read property fileCron 无法读取属性文件
【发布时间】:2012-09-30 05:13:25
【问题描述】:

我从 cron 收到这些错误消息(当我检查邮件时)

/usr/Mytest/Log_Deleter.sh[3]: ./Log_Deleter.prop:  not found.

在我的脚本中...

#!/bin/ksh
. ./Log_Deleter.prop

我的脚本和属性文件位于 /usr/Mytest

我不确定为什么 cron 不能识别这个文件。当我从文件夹执行时,它工作正常,但我不明白它为什么会导致错误。

提前致谢!

【问题讨论】:

    标签: bash shell unix cron aix


    【解决方案1】:

    你必须这样做:

    #!/bin/ksh
    
    cd /usr/Mytest
    . ./Log_Deleter.prop
    

    或者给出完整的路径:

    . /usr/Mytest/Log_Deleter.prop
    

    【讨论】:

    • ls -l /usr/Mytest/Log_Deleter.prop 的输出是什么?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-23
    • 1970-01-01
    • 1970-01-01
    • 2020-02-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多