File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ DB_PASSWORD=$(cat ${DB_PASSWORD_FILE})
1111DB_USER=$( cat ${DB_USERNAME_FILE} )
1212PROM_NAMESPACE=${PROM_NAMESPACE:- dboperator}
1313
14+ if [[ -z " ${STORAGE_BUCKET} " ]]; then
15+ echo " Variable STORAGE_BUCKET must be set"
16+ exit 1
17+ fi
18+
1419# create login credential file
1520(umask 377 && echo * :5432:* :${DB_USER} :${DB_PASSWORD} >> ~ /.pgpass)
1621
@@ -21,8 +26,8 @@ echo "End backup"
2126
2227# # copy to destination
2328echo " Copy to gcs"
24- # rclone copy "${BACKUP_FILE}" "storage://${STORAGE_BUCKET}"
25- # gsutil cp ${BACKUP_FILE} gs ://${GCS_BUCKET }/${DB_NAME}/${BACKUP_FILE} && gsutil cp ${BACKUP_FILE} gs://${GCS_BUCKET}/${DB_NAME}/${ BACKUP_FILE_LATEST}
29+ rclone copy " ${BACKUP_FILE} " " storage://${STORAGE_BUCKET} / ${DB_NAME} / ${BACKUP_FILE }"
30+ rclone copy " ${BACKUP_FILE} " " storage ://${STORAGE_BUCKET } /${DB_NAME} /${BACKUP_FILE_LATEST} "
2631
2732END_TIMESTAMP=$( date +%s)
2833BACKUP_DURATION=$(( END_TIMESTAMP - START_TIMESTAMP))
You can’t perform that action at this time.
0 commit comments