系统任务

清理、夜间备份和运行器中心循环的运行时间

  1. 示例
  2. 变量

修改这些变量,可以把系统任务移到其他时间,或让运行器中心的循环运行得更频繁或更少。


示例

在凌晨 1:00 备份,在凌晨 1:30 清理作业,并每 5 秒把作业分派给运行器。在 compose 项目的 .env 中:

NIGHTLY_BACKUP_CRON="0 1 * * *"
JOB_CLEANUP_CRON="30 1 * * *"
RUNNER_DISPATCH_SECONDS=5

_CRON 变量接受一个 5 字段的 cron(分钟、小时、日、月和星期),时区为服务器的时区 LOG_TZ。作业 > 系统下每个任务的计划标签页会写入其变量,并立即在所有节点上应用, 无需重启。配置种子重新加载有自己的变量 CONFIG_SEED_RELOAD_CRON,与配置种子的变量放在一起。


变量

本组的所有变量,包括其类型、默认值和描述:

变量 可选值/默认值 说明
JOB_CLEANUP_CRON
string
added in version 7.8.0
默认值:
30 2 * * *

Job cleanup schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Job cleanup system task runs: it removes the finished jobs older than JOB_RETENTION_DAYS. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every day at 2:30 AM. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

AUDIT_CLEANUP_CRON
string
added in version 7.8.0
默认值:
30 3 * * *

Audit log cleanup schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Audit log cleanup system task runs: it removes the audit entries older than AUDIT_RETENTION_DAYS. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every day at 3:30 AM. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

TOKEN_CLEANUP_CRON
string
added in version 7.8.0
默认值:
0 3 * * *

Expired tokens cleanup schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Expired tokens system task runs: it removes the expired sign-in tokens, revocations and API tokens. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every day at 3:00 AM. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

STORED_JOB_CLEANUP_CRON
string
added in version 7.8.0
默认值:
0 4 * * *

Stored jobs cleanup schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Stored jobs cleanup system task runs: it removes the stored jobs past their expiry date or unused for STORED_JOB_UNUSED_DAYS, and forgets the nodes gone for a day. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every day at 4:00 AM. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

NIGHTLY_BACKUP_CRON
string
added in version 7.8.0
默认值:
0 0 * * *

Nightly backup schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Nightly backup system task runs: it backs up the database and removes the oldest nightly backups beyond NIGHTLY_BACKUP_RETENTION. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every day at midnight. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

ABANDONED_JOBS_CRON
string
added in version 7.8.0
默认值:
0 * * * *

Abandoned jobs schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Abandoned jobs system task runs: it ends the jobs that ran a day without output and that no runner took. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every hour. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

DEAD_NODES_CRON
string
added in version 7.8.0
默认值:
* * * * *

Stopped nodes schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Stopped nodes system task runs: it frees the jobs, claims and runners held by nodes and RTEs that stopped answering. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every minute. Running it less often leaves the work of a stopped node waiting longer before another takes it. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

SCHEDULE_RESYNC_CRON
string
added in version 7.8.0
默认值:
*/5 * * * *

Schedule resync schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Schedule resync system task runs: the worker reads the schedules and the repository pulls from the database again. Each change already reaches it at once; this is the safety net for a change notice it missed. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every 5 minutes. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

SCHEDULE_ENDS_CRON
string
added in version 7.8.0
默认值:
* * * * *

Schedule ends schedule (cron)
a cron of 5 fields (minute hour day month weekday) that runs again

When the Schedule ends system task runs: it turns off or removes the schedules that reached their end. A cron of 5 fields in the app’s timezone (LOG_TZ); the default runs it every minute. Changed on the task’s own page, Jobs > System > the task > Schedule, which saves it to the managed settings file and applies it at once on every node, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

RUNNER_DISPATCH_SECONDS
number
added in version 7.8.0
默认值:
2

Runner dispatch interval (seconds)
a whole number of seconds from 1 to 60

How often the Runner dispatch loop of the runner hub runs, in seconds: it hands the waiting jobs and the cancels to their runners. A job or a cancel launched on another node reaches its runner at the next round; the default runs it every 2 seconds. Changed on the loop’s own page, Jobs > System > the loop > Schedule, which saves it to the managed settings file and applies it at once on every node that runs the hub, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

RUNNER_DIAL_SECONDS
number
added in version 7.8.0
默认值:
10

Runner inbound dial interval (seconds)
a whole number of seconds from 2 to 300

How often the Runner inbound dial loop of the runner hub runs, in seconds: it dials the inbound runners this node may hold. An inbound runner that lost its socket is dialed again at the next round; the default runs it every 10 seconds. Changed on the loop’s own page, Jobs > System > the loop > Schedule, which saves it to the managed settings file and applies it at once on every node that runs the hub, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.

RUNNER_PRUNE_SECONDS
number
added in version 7.8.0
默认值:
60

Runner ended jobs prune interval (seconds)
a whole number of seconds from 10 to 3600

How often the Runner ended jobs prune loop of the runner hub runs, in seconds: it lets go what a node kept of jobs that ended elsewhere. The default runs it every 60 seconds. Changed on the loop’s own page, Jobs > System > the loop > Schedule, which saves it to the managed settings file and applies it at once on every node that runs the hub, without a restart. Set in the real environment (or with ALLOW_ENV_EDIT=0), the page shows it read only.