From 198a80cfae6794e4fa3366c1472374db001cae51 Mon Sep 17 00:00:00 2001 From: Daniel Legt Date: Fri, 2 Feb 2024 00:31:11 +0200 Subject: [PATCH] * Fixed postgres backup --- postgres/postgres_backup.sh | 6 +++--- postgres/required_programs.txt | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 postgres/required_programs.txt diff --git a/postgres/postgres_backup.sh b/postgres/postgres_backup.sh index 853069d..827dff5 100755 --- a/postgres/postgres_backup.sh +++ b/postgres/postgres_backup.sh @@ -59,7 +59,7 @@ upload_to_google_drive() { if [ -n "$GOOGLE_DRIVE_FOLDER_ID" ] && [ -n "$BACKUP_FILE" ]; then log "Uploading backup to google drive." - gdrive upload --parent $GOOGLE_DRIVE_FOLDER_ID $BACKUP_FILE + gdrive files upload --parent $GOOGLE_DRIVE_FOLDER_ID $BACKUP_FILE if [ $? -eq 0 ]; then log "Backup file uploaded to Google Drive." send_discord_notification "Backup file uploaded to Google Drive." "65280" @@ -75,7 +75,7 @@ upload_to_google_drive() { delete_old_gdrive_backups() { if [ -n "$GOOGLE_DRIVE_FOLDER_ID" ] && [ -n "$GOOGLE_DRIVE_KEEP_BACKUP_COUNT" ]; then - GCLOUD_BACKUPS=$(gdrive list --query "'$GOOGLE_DRIVE_FOLDER_ID' in parents" --order "createdTime" --no-header | awk '{print $1}') + GCLOUD_BACKUPS=$(gdrive files list --query "'$GOOGLE_DRIVE_FOLDER_ID' in parents" --order "createdTime" --no-header | awk '{print $1}') BACKUP_COUNT=$(echo "$GCLOUD_BACKUPS" | wc -l) log "Deleting old gdrive backups." @@ -86,7 +86,7 @@ delete_old_gdrive_backups() { echo "$DELETE_BACKUPS" | while read -r BACKUP_ID; do if [ -n "$BACKUP_ID" ]; then - gdrive delete $BACKUP_ID + gdrive files delete $BACKUP_ID if [ $? -eq 0 ]; then local MSG_X="Deleted old backup with ID ${BACKUP_ID} from Google Drive." log "${MSG_X}" diff --git a/postgres/required_programs.txt b/postgres/required_programs.txt new file mode 100644 index 0000000..6692088 --- /dev/null +++ b/postgres/required_programs.txt @@ -0,0 +1,3 @@ +docker +*gdrive +*curl \ No newline at end of file