Cron API

Per-user crontab management, /etc/cron.d files, and entry scheduling.

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


Owner & Crontab

MethodPathDescription
GET/cron/ownersList cron owners
GET/cron/:ownerList user's cron jobs
POST/cron/:ownerAdd cron job
PUT/cron/:owner/:idxEdit cron job
DELETE/cron/:owner/:idxDelete cron job
PUT/cron/:owner/:idx/toggleEnable/disable job
GET/cron/describeHuman-readable description

/etc/cron.d

MethodPathDescription
GET/cron/cron-dList cron.d files
GET/cron/cron-d/:fileRead cron.d file
PUT/cron/cron-d/:fileSave cron.d file
DELETE/cron/cron-d/:fileDelete cron.d file

Request/Response

POST /cron/:owner

{
  "schedule": "0 2 * * *",
  "command": "/opt/scripts/backup.sh",
  "shorthand": null
}

Shorthand options: @reboot, @yearly, @monthly, @weekly, @daily, @hourly

GET /cron/:owner

{
  "owner": "root",
  "entries": [
    {
      "index": 0,
      "schedule": "0 2 * * *",
      "command": "/opt/scripts/backup.sh",
      "enabled": true,
      "description": "Daily at 02:00",
      "nextRun": "2026-07-29T02:00:00Z",
      "shorthand": null
    }
  ],
  "stats": { "total": 5, "active": 4, "disabled": 1 }
}

PUT /cron/:owner/:idx/toggle

Toggles enabled/disabled by commenting/uncommenting the entry.


Part of NexusPanel API Reference

← Back to Documentation