gcloud Verified current stable Not installed? Cloud Infrastructure

Gcloud / Retrieve Backup Information

Retrieve Backup Information

Retrieve backup details for a Cloud SQL instance.

$
Terminal
gcloud sql backups describe <backup_id> --instance=<instance_id>

When To Use

During incident recovery or database snapshot verification.

Pro Tip

Use the flag `--format=yaml` to output structured configurations for better readability.

Anatomy of Output

Understanding the result

bak_12345 Backup ID

Unique identifier for the requested backup.

instance-1 Instance ID

The specific Cloud SQL instance from which backup is derived.

2023-10-01T12:00:00Z Created At

Timestamp indicating when the backup was initiated.

Troubleshooting

Common pitfalls

ERROR: (gcloud.sql.backup.describe) NOT_FOUND: Backup <backup_id> not found.

Solution: Verify the backup ID and ensure it exists in the current instance.

ERROR: (gcloud.sql.backup.describe) PERMISSION_DENIED: The user does not have access to this backup.

Solution: Check IAM roles for requisite permissions on Cloud SQL resources.

ERROR: (gcloud.sql.backup.describe) INVALID_ARGUMENT: The provided instance ID is invalid.

Solution: Confirm that the instance ID is correctly spelled and exists.

Command Breakdown

What each part is doing

gcloud
Base Command
The executable that performs this operation. Here it runs Gcloud before the shell applies any redirect operators.
<backup_id>
backup id
The value supplied for backup id.
<instance_id>
instance id
The value supplied for instance id.
--instance=<instance_id>
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.