This repository was archived by the owner on Dec 14, 2023. It is now read-only.
File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
+
2
3
set -e
3
4
4
5
: " ${S3_BUCKET:? " No value supplied for s3 bucket name" } "
@@ -10,8 +11,7 @@ echo "Checking Credentials before starting backup"
10
11
: " ${PGUSER:? " Need to set PGUSER non-empty?" } "
11
12
: " ${PGPASSWORD:? " Need to set PGPASSWORD non-empty?" } "
12
13
13
- if [ ! -e ~ /.aws/credentials ]
14
- then
14
+ if [ ! -e ~ /.aws/credentials ]; then
15
15
echo " AWS credentials file not found." >&2
16
16
: " ${AWS_ACCESS_KEY_ID:? " Need to set AWS_ACCESS_KEY_ID non-empty?" } "
17
17
: " ${AWS_SECRET_ACCESS_KEY:? " Need to set AWS_SECRET_ACCESS_KEY non-empty?" } "
@@ -22,7 +22,7 @@ args=("$@")
22
22
dump_command=" pg_dump -j 12 -Fd -f backup_dump ${args[*]} '${PGDATABASE} ' --verbose"
23
23
echo " Starting ${dump_command} "
24
24
eval " $dump_command "
25
- if [ " $( ls -A backup_dump) " ] ; then
25
+ if [ " $( ls -A backup_dump) " ]; then
26
26
echo " PGDUMP Complete"
27
27
else
28
28
echo " PGDUMP failed"
@@ -40,8 +40,6 @@ if aws s3 ls "s3://$S3_BUCKET" 2>&1 | grep -q 'NoSuchBucket'; then
40
40
echo " Create s3://${S3_BUCKET} "
41
41
aws s3 mb --region " $S3_REGION " s3://" $S3_BUCKET "
42
42
sleep 30
43
- else
44
- echo " ${S3_BUCKET} bucket exists"
45
43
fi
46
44
47
45
aws s3 cp --region " $S3_REGION " " $zipped_filename " s3://" $S3_BUCKET "
You can’t perform that action at this time.
0 commit comments