From fe3cbdd4c019528f7ccf6a2ab364b5ee78706937 Mon Sep 17 00:00:00 2001 From: Hari Sekhon Date: Tue, 13 Oct 2020 16:22:02 +0100 Subject: [PATCH] updated gcp_sql_backup.sh --- gcp_sql_backup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcp_sql_backup.sh b/gcp_sql_backup.sh index 9ab573d5..c7f1711b 100755 --- a/gcp_sql_backup.sh +++ b/gcp_sql_backup.sh @@ -46,6 +46,9 @@ no_more_opts "$@" sql_instances="$*" if [ -z "$sql_instances" ]; then + # XXX: backups cannot be run for stopped instances or read replicas: + # ERROR: (gcloud.sql.backups.create) HTTPError 400: This operation is not valid for this instance. + # ERROR: (gcloud.sql.backups.create) HTTPError 400: Backups cannot be enabled for read replica instances. sql_instances="$(gcloud sql instances list --format=json | jq -r '.[] | select(.instanceType != "READ_REPLICA_INSTANCE") | select(.state == "RUNNABLE") | .name')" fi