| name | list-available-backups-with-show-backups |
| description | List all available CockroachDB backups in a storage location using SHOW BACKUPS command. Use when user asks "list backups", "show all backups", "available backups", "backup history", or needs to find restore points and manage retention. |
| metadata | {"domain":"Backup and Restore","bloom_level":"Apply","version":"1.0.0","cockroachdb_version":"v26.1.0+"} |
List Available Backups with SHOW BACKUPS
Discover all backup timestamps in a storage location to identify available restore points.
Basic Syntax
SHOW BACKUPS IN 'nodelocal://1/backups/cluster';
What SHOW BACKUPS Returns
Output Format
Returns list of backup subdirectories (timestamp paths):
path
--------------------------
/2026/01/14-020000.00
/2026/01/15-020000.00
/2026/01/16-020000.00
/2026/01/17-020000.00
Understanding Backup Paths
Format: /YYYY/MM/DD-HHMMSS.ms
Example: /2026/01/15-143022.50
- Date: January 15, 2026
- Time: 14:30:22.50 (2:30 PM)
Each path represents either:
- A full backup (starts new chain)
- Part of an incremental chain
Step-by-Step Usage
1. List All Backups
SHOW BACKUPS IN 'nodelocal://1/backups/cluster';
2. Identify Restore Points
RESTORE FROM '2026/01/15-143022.50' IN 'nodelocal://1/backups/cluster';
RESTORE FROM LATEST IN 'nodelocal://1/backups/cluster';
3. Inspect Specific Backup
SHOW BACKUP FROM '2026/01/15-143022.50' IN 'nodelocal://1/backups/cluster';
Common Patterns
Pattern 1: Find Recent Backups
SHOW BACKUPS IN 'nodelocal://1/backups/prod';
Pattern 2: Backup Chain Identification
SHOW BACKUPS IN 'nodelocal://1/backups/weekly';
Pattern 3: Retention Management
SHOW BACKUPS IN 'nodelocal://1/backups/prod';
Multiple Storage Locations
Check Different Destinations
SHOW BACKUPS IN 'nodelocal://1/backups/prod';
SHOW BACKUPS IN 'nodelocal://1/backups/dev';
SHOW BACKUPS IN 'nodelocal://1/backups/archive';
Cloud Storage Locations
SHOW BACKUPS IN 's3://bucket/backups/prod?AWS_ACCESS_KEY_ID=xxx&AWS_SECRET_ACCESS_KEY=yyy';
SHOW BACKUPS IN 'gs://bucket/backups/prod?AUTH=specified&CREDENTIALS=xxx';
SHOW BACKUPS IN 'azure://container/backups?AZURE_ACCOUNT_NAME=xxx&AZURE_ACCOUNT_KEY=yyy';
Understanding Backup Chains
Identifying Chain Boundaries
Full backup starts new chain:
- First backup in location
- After
BACKUP INTO (without LATEST)
- First backup each week in scheduled backup
Incremental backups extend chain:
- Created with
BACKUP INTO LATEST
- Timestamp newer than previous backup
Example chain structure:
Chain 1:
/2026/01/14-020000.00 (Full)
/2026/01/15-020000.00 (Incr)
/2026/01/16-020000.00 (Incr)
Chain 2:
/2026/01/21-020000.00 (Full - new chain)
/2026/01/22-020000.00 (Incr)
Combining with Inspection
Workflow: List then Inspect
SHOW BACKUPS IN 'nodelocal://1/backups/prod';
SHOW BACKUP FROM '2026/01/15-143022.50' IN 'nodelocal://1/backups/prod';
RESTORE FROM '2026/01/15-143022.50' IN 'nodelocal://1/backups/prod';
Use Cases
Disaster Recovery Planning
Find most recent full backup:
SHOW BACKUPS IN 'nodelocal://1/backups/dr';
Point-in-Time Recovery
Find backup closest to target time:
SHOW BACKUPS IN 'nodelocal://1/backups/pitr';
Compliance Auditing
Verify retention policy compliance:
SHOW BACKUPS IN 'nodelocal://1/backups/compliance';
Empty Location
If no backups exist:
SHOW BACKUPS IN 'nodelocal://1/backups/empty';
This is expected for new backup locations.
Troubleshooting
Error: "backup not found" or "directory does not exist"
Cause: Storage location doesn't exist or inaccessible
Solution:
No Backups Listed
Possible causes:
- No backups created yet (expected)
- Wrong storage location
- Backups deleted
- Permission issues
Verify:
BACKUP DATABASE defaultdb INTO 'nodelocal://1/backups/test';
SHOW BACKUPS IN 'nodelocal://1/backups/test';
Cannot Access Cloud Storage
Error: Authentication or permission error
Solution:
- Verify credentials in URI
- Check IAM permissions
- Test connectivity to cloud provider
Best Practices
- Document backup locations for disaster recovery runbooks
- Regularly list backups to verify scheduled backups running
- Monitor backup count to detect missed backups
- Use consistent locations for easier management
- Implement retention policies based on backup listings
Automation Example
Monitor backup freshness:
SHOW BACKUPS IN 'nodelocal://1/backups/prod';
Related Skills
inspect-backup-contents-with-show-backup - Inspect specific backup contents
execute-cluster-level-full-backups - Create backups to list
create-incremental-backups-with-backup-into-latest - Add to backup chain
restore-database-from-backup - Restore from listed backups