We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7f0319e + f62406e commit cbb237cCopy full SHA for cbb237c
backup.sh
@@ -17,6 +17,11 @@ fi
17
18
export PGPASSWORD=${POSTGRES_PASSWORD}
19
20
+mkdir --parents $backup_path
21
+cd $backup_path
22
+
23
+echo "Starting $1 backup in $(pwd)"
24
25
# Will create base backup
26
echo "Backing up [${POSTGRES_USER}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}] to\
27
[${S3_ENDPOINT}], extra opts - [${POSTGRES_EXTRA_OPTS}]."
@@ -64,7 +69,8 @@ mcli cp "${ARCHIVE_FILE_NAME}" "${S3_ALIAS}"/"${relative_s3_object_path}"
64
69
65
70
# Do clean up
66
71
echo "Maid is here... Doing cleaning..."
67
-rm --force "${POSTGRES_DB}".*
72
+cd ..
73
+rm --recursive --force $backup_path
68
74
75
# Do announce
76
# We are not going to spam chat every hour. Excluded hourly backups from notifications
0 commit comments