Skip to content

1251 - 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: "pg_dump $DATABASE_URL"
      enabled: false
    }

    {
      name: "refresh-cache"
      schedule: "0 * * * *"
      command: "./bin/sync --all"
      enabled: true
    }

    {
      name: "refresh-cache"
      schedule: "0 2 * * 0"
      command: "./bin/sync --all"
      enabled: true
    }

    {
      name: "rotate-logs"
      schedule: "0 * * * *"
      command: "python manage.py report"
      enabled: false
    }

    {
      name: "rotate-logs"
      schedule: "0 2 * * 0"
      command: "./bin/sync --all"
      enabled: true
    }

    {
      name: "send-reports"
      schedule: "0 0 * * *"
      command: "pg_dump $DATABASE_URL"
      enabled: true
    }
  ]
}

See Also