【发布时间】:2014-04-10 07:30:55
【问题描述】:
我为 graffiti-monkey 安排了一个 cron 作业:
15 0 * * * /home/ubuntu/scripts/graffiti_monkey.sh
但它没有执行并且日志显示
[ERROR] No AWS credentials found - check your credentials
如何将 aws 凭据提供给 .sh 文件以便 cron 执行它?
【问题讨论】:
-
取决于你的脚本在做什么。请详细说明。
-
/usr/local/bin/graffiti-monkey --region ap-southeast-1
-
graffiti_monkey.sh的权限是什么? -
脚本正在运行但显示 aws 凭据错误
-
很可能,您的 AWS 凭证位于某个配置文件中,即
sourced。因此,如果您手动运行脚本,它会工作,但它会通过 cron 失败,因为 cron 无法读取 shell 级别的变量。所以source你在你的cron中的凭据。例如15 0 * * * source ~/.bashrc && /home/ubuntu/scripts/graffiti_monkey.sh
标签: bash amazon-web-services cron