cron から AWS CLI を実行してみたメモ。
$ crontab -l
* * * * * /bin/bash /home/ec2-user/jobs/job01.sh
export LANG=C
export TZ="Asia/Tokyo"
BASE_DIR=$(cd $(dirname $0);pwd)
BASE_NAME=$(basename $0)
STEM="${BASE_NAME%.*}"
AWS_CONFIG_FILE=~/.aws/config
cd ${BASE_DIR}
aws s3 ls | awk '{print strftime("%Y/%m/%d %H:%M:%S"), $0; fflush()}' >> ${STEM}.log
$ head job01.log
2018/05/04 03:32:01 2018-04-05 01:42:38 20170824-...
2018/05/04 03:32:01 2017-07-31 23:04:24 aws-...
2018/05/04 03:32:01 2017-05-01 18:30:11 aws-...