Skip to main content

Cron Service Management

Get Cron Configuration - /api/cron-config​

  • Endpoint: /api/cron-config
  • Method: GET
  • Description: Retrieves the current cron service configuration.
  • Authentication: Requires valid session and CSRF token
  • Response:
    {
    "cronExpression": "*/20 * * * *",
    "enabled": true
    }
  • Error Responses:
    • 500: Failed to get cron configuration
  • Notes:
    • Returns current cron service configuration
    • Includes cron expression and enabled status
    • Used for cron service management

Update Cron Configuration - /api/cron-config​

  • Endpoint: /api/cron-config
  • Method: POST
  • Description: Updates the cron service configuration.
  • Authentication: Requires valid session and CSRF token
  • Request Body:
    {
    "interval": "20min"
    }
  • Response:
    {
    "success": true
    }
  • Available Intervals: "disabled", "1min", "5min", "10min", "15min", "20min", "30min", "1hour", "2hours"
  • Error Responses:
    • 400: Interval is required
    • 500: Failed to update cron configuration
  • Notes:
    • Updates cron service configuration
    • Validates interval against allowed options
    • Affects overdue backup check frequency

Cron Service Proxy - /api/cron/*​

  • Endpoint: /api/cron/*
  • Method: GET, POST
  • Description: Proxies requests to the cron service. This endpoint forwards all requests to the cron service running on a separate port.
  • Authentication: Requires valid session and CSRF token. GET is allowed for authenticated users; POST (start/stop/trigger/reload) requires an administrator.
  • Parameters:
    • *: Any path that will be forwarded to the cron service
  • Response: Depends on the cron service endpoint being accessed
  • Error Response (503):
    {
    "error": "Cron service is not running",
    "message": "The cron service is not available. Please start it with: npm run cron:start"
    }
  • Notes:
    • Proxies requests to the cron service on 127.0.0.1
    • Forwards CRON_SERVICE_SECRET as X-Cron-Service-Secret when set
    • Returns 503 if cron service is not available
    • Supports both GET and POST methods
    • Used for cron service management from the web interface
    • POST /trigger/daily-summary-dispatch is rejected by the cron service; use /api/configuration/daily-summary/send instead
    • POST /trigger/database-compact runs the weekly compact immediately (orphan backups/servers and notification settings, plus SQLite VACUUM)