服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

shell脚本在cron中无法正确运行

可能重复: shell脚本在cron中不能正常运行 我想调用一个我从cron写的shell脚本。 shell脚本使用程序Linkchecker。 如果我从terminal运行shell脚本,它工作得很好。 但是,当cron运行时,我得到以下错误: 从linkcheck.director import console,check_urls,get_aggregate中的第40行的文件“/ Users / keith / etc / cron / linkchecker” 文件“/opt/local/lib/python2.5/site-packages/linkcheck/director/init.py”,第25行,来自。 导入聚合器,控制台文件“/opt/local/lib/python2.5/site-packages/linkcheck/director/aggregator.py”,第25行中的from。 导入logging器,状态,检查器,清理文件“/opt/local/lib/python2.5/site-packages/linkcheck/director/status.py”,第20行中的from。 导入任务文件“/opt/local/lib/python2.5/site-packages/linkcheck/director/task.py”,第20行中的from。 导入控制台文件“/opt/local/lib/python2.5/site-packages/linkcheck/director/console.py”,第27行,在stderr = codecs.getwriter(i18n.default_encoding)(sys.stderr,errors =“忽略“)在getwriter返回查找(编码).streamwriter LookupError:未知编码的文件”/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/codecs.py“,行930,回溯(最近一次通话最后): 从linkcheck.director import console,check_urls,get_aggregate中的第40行的文件“/ Users / keith / etc / cron / linkchecker” 文件“/opt/local/lib/python2.5/site-packages/linkcheck/director/init.py”,第25行,来自。 导入聚合器,控制台文件“/opt/local/lib/python2.5/site-packages/linkcheck/director/aggregator.py”,第25行中的from。 导入logging器,状态,检查器,清理文件“/opt/local/lib/python2.5/site-packages/linkcheck/director/status.py”,第20行中的from。 导入任务文件“/opt/local/lib/python2.5/site-packages/linkcheck/director/task.py”,第20行中的from。 导入控制台文件“/opt/local/lib/python2.5/site-packages/linkcheck/director/console.py”,第27行,在stderr = codecs.getwriter(i18n.default_encoding)(sys.stderr,errors =“忽略“)在getwriter返回查找(编码).streamwriter LookupError:未知编码的文件”/opt/local/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/codecs.py“,行930,回溯(最近一次通话最后): 从linkcheck.director import console,check_urls,get_aggregate中的第40行的文件“/ Users / keith / […]