Skip to content

544 - Cron Jobs

Scheduled task definitions. This is an example of a MAML document.

maml
{
  timezone: "America/New_York"
  jobs: [
    {
      name: "cleanup-temp"
      schedule: "*/15 * * * *"
      command: "python manage.py report"
      enabled: false
    }

    {
      name: "sync-data"
      schedule: "*/15 * * * *"
      command: "./bin/sync --all"
      enabled: true
    }

    {
      name: "cleanup-temp"
      schedule: "0 * * * *"
      command: "pg_dump $DATABASE_URL"
      enabled: true
    }

    {
      name: "backup-db"
      schedule: "0 0 * * *"
      command: "pg_dump $DATABASE_URL"
      enabled: true
    }

    {
      name: "backup-db"
      schedule: "*/15 * * * *"
      command: "python manage.py report"
      enabled: true
    }

    {
      name: "refresh-cache"
      schedule: "30 6 * * 1-5"
      command: "node scripts/cleanup.js"
      enabled: true
    }
  ]
}

See Also