bash文件在awscli命令后部分执行

时间:2018-04-03 16:13:03

标签: bash shell amazon-s3 aws-cli

我的bash文件中有以下内容:

#!/bin/bash

export AWS_ACCESS_KEY_ID=******
export AWS_SECRET_ACCESS_KEY=******
BUCKET=maths-ws

DB_USER= abcd
DB_PASS=****4
DB_HOST=127.0.0.1
DIR="/home/ubuntu/mathsheet/envm/bin/"
cd $DIR
source activate    
cd ../../maths-ws/trunk

PGPASSWORD=$DB_PASS pg_dump -Fc --no-acl -h $DB_HOST -U $DB_USER math_sheet > pg_backup.json

exec /home/ubuntu/mathsheet/envm/bin/aws s3 cp pg_backup.json s3://maths-ws/backups/db/$(date "+%Y-%m-%d-%H-%M-%S")-backup.gz --sse AES256
<------ command is executing till here.My execution terminates here.
exec rm -f pg_backup.json  <---- this is not executing

我也使用了this回答,但它对我不起作用。

0 个答案:

没有答案