awscliはワイルドカードでファイル指定できないようなので、lsってから1個ずつ落とす必要があるようです。 バケット内のtar.gzを落とします。
#!/bin/sh
DATE_STRING=`date "+%Y%m%d"`
OUTDIR="/var/tmp/${DATE_STRING}"
mkdir -p $OUTDIR
files=`aws s3 --profile {prof} ls s3://{bucket/dir}/ | grep "tar.gz" | awk '{print $4}'`
for file in $files
do
if [ -f "${OUTDIR}/${file}" ]; then
echo "file already exists: ${OUTDIR}/${file}"
continue
fi
echo "{bucket/dir}/${file} downloading ..."
aws s3 --profile {prof} cp s3://{bucket/dir}/${file} ${OUTDIR}/
if [ $? -eq 0 ]; then
echo "download complete: ${OUTDIR}/${file}"
fi
done


