ssh_backup_list
List available backups on remote servers to manage database and file recovery options, filtering by backup type and specifying directories.
Instructions
List available backups on remote server
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| server | Yes | Server name | |
| type | No | Filter by backup type | |
| backupDir | No | Backup directory (default: /var/backups/ssh-manager) |
Implementation Reference
- src/tool-registry.js:41-46 (registration)The 'ssh_backup_list' tool is listed/registered in the backup tool group within the central tool registry.backup: [ 'ssh_backup_create', 'ssh_backup_list', 'ssh_backup_restore', 'ssh_backup_schedule' ],
- src/backup-manager.js:389-400 (helper)Generates the shell command to list backups by finding and cat-ing metadata files on the remote server.export function buildListBackupsCommand(backupDir = DEFAULT_BACKUP_DIR, type = null) { let command = `find "${backupDir}" -name "*.meta.json" -type f`; if (type) { command += ` | grep "${type}_"`; } // Read and parse each metadata file command += ' | while read -r file; do cat "$file"; echo "---"; done'; return command; }
- src/backup-manager.js:405-424 (helper)Parses the output from the list backups command into structured backup metadata array, sorted by creation date.export function parseBackupsList(output) { if (!output || !output.trim()) { return []; } const backups = []; const metadataBlocks = output.split('---').filter(b => b.trim()); for (const block of metadataBlocks) { try { const metadata = JSON.parse(block.trim()); backups.push(metadata); } catch (error) { logger.warn('Failed to parse backup metadata', { error: error.message, block }); } } // Sort by created_at descending return backups.sort((a, b) => new Date(b.created_at) - new Date(a.created_at)); }