feature: conditionning dumpall with if-exists
Some checks are pending
Main / build (push) Waiting to run

This commit is contained in:
RouxAntoine 2023-12-03 14:57:51 +01:00
parent 34dda4a918
commit 49837807e7
Signed by: antoine
GPG Key ID: 098FB66FC0475E70

View File

@ -9,7 +9,7 @@ backUpFilePath="$BACKUP_DESTINATION_FOLDER/$backUpFileName"
echo "$dt - Starting DB backup into file: $backUpFilePath";
echo "$dt - Running: pg_dumpall -h $BACKUP_SOURCE_DB_HOST_NAME -U $POSTGRES_USER -c | gzip > $backUpFilePath"
pg_dumpall -h $BACKUP_SOURCE_DB_HOST_NAME -U $POSTGRES_USER -c | gzip > $backUpFilePath
pg_dumpall --if-exists -h $BACKUP_SOURCE_DB_HOST_NAME -U $POSTGRES_USER -c | gzip > $backUpFilePath
if [ $? -ne 0 ]; then
rm $backUpFilePath