Skip to main content
Glama

ssh_backup_schedule

Schedule automated backups for databases and files on SSH servers using cron. Configure retention periods and specify backup types including MySQL, PostgreSQL, MongoDB, and file systems.

Instructions

Schedule automatic backups using cron

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverYesServer name
scheduleYesCron schedule (e.g., "0 2 * * *" for daily at 2 AM)
typeYesBackup type
nameYesBackup name
databaseNoDatabase name (for db types)
pathsNoPaths to backup (for files type)
retentionNoRetention period in days (default: 7)

Implementation Reference

  • Registration of 'ssh_backup_schedule' tool in the backup group of TOOL_GROUPS
    // Backup group (4 tools) - Backup and restore operations backup: [ 'ssh_backup_create', 'ssh_backup_list', 'ssh_backup_restore', 'ssh_backup_schedule' ],
  • Core helper function to build the shell command for scheduling a backup job using crontab on the remote server
    * Build cron schedule command */ export function buildCronScheduleCommand(schedule, backupCommand, cronComment) { // Add cron job with comment const cronLine = `${schedule} ${backupCommand} # ${cronComment}`; return `(crontab -l 2>/dev/null; echo '${cronLine}') | crontab -`; }
  • Helper function to parse the output of crontab -l and extract scheduled backup jobs
    /** * Parse cron list output */ export function parseCronJobs(output) { if (!output || !output.trim()) { return []; } const jobs = []; const lines = output.split('\n'); for (const line of lines) { if (line.trim() && !line.startsWith('#') && line.includes('ssh-manager-backup')) { const parts = line.split('#'); const schedule = parts[0].trim(); const comment = parts[1] ? parts[1].trim() : ''; jobs.push({ schedule, comment, command: schedule.split(/\s+/).slice(5).join(' ') }); } } return jobs; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bvisible/mcp-ssh-manager'

If you have feedback or need assistance with the MCP directory API, please join our Discord server