Backups API

Backup target management, execution, scheduling, and archive download.

All endpoints are prefixed with /api/backups. Admin only.


Targets & Stats

MethodPathDescription
GET/backups/defsBackup target definitions
GET/backups/statsBackup statistics

Execution

MethodPathDescription
POST/backups/startStart backup
POST/backups/:task/cancelCancel backup
GET/backups/status/:taskBackup status
GET/backups/currentRunning backup info

Archive Management

MethodPathDescription
GET/backups/listList backups
GET/backups/:tsBackup detail
GET/backups/:ts/downloadDownload backup ZIP
GET/backups/:ts/download/:fileDownload single file
DELETE/backups/:tsDelete backup

Schedules

MethodPathDescription
GET/backups/schedulesList schedules
POST/backups/schedulesCreate schedule
PUT/backups/schedules/:id/toggleEnable/disable schedule
DELETE/backups/schedules/:idDelete schedule

Request/Response

POST /backups/start

{
  "type": "full",
  "targets": ["system", "databases", "webfiles"]
}

Response

{
  "success": true,
  "taskId": "task_1690000000000",
  "message": "Backup started"
}

GET /backups/status/:task

{
  "taskId": "task_1690000000000",
  "status": "running",
  "progress": 65,
  "currentFile": "/var/www/html/app.js",
  "filesProcessed": 273,
  "totalFiles": 420,
  "elapsed": 45,
  "eta": 24
}

Schedule

{
  "name": "Daily System Backup",
  "type": "full",
  "schedule": "0 2 * * *",
  "retention": 7,
  "targets": ["system", "databases"]
}

Part of NexusPanel API Reference

← Back to Documentation