Skip to content

Cronjobs

The Syncer manages all its automation cronjobs internally. You define which modules to run, in what order, and for which accounts — all from the UI.

Cronjob Groups

Go to: Cronjobs → Cronjob Groups

A Cronjob Group defines:

  • An interval — how often the group should run
  • A time range — the window during which the group is allowed to run
  • An ordered list of jobs to execute

Jobs inside a group run sequentially. If any job fails, the entire group stops. This is intentional — for example, you do not want hosts to be deleted from Checkmk if the import step failed beforehand.

State Table

Go to: Cronjobs → State Table

The State Table keeps one entry per group, showing:

  • When the group will run next
  • The result of the last run
  • Any error messages

To force a group to run immediately or to reset its state, delete or edit its State Table entry.

Status panel on the start page

Since 4.3

The dashboard (start page) shows a Cron Jobs panel below Recent Errors with each group's status — ok, running, error or disabled, plus a queued marker when a one-off run is already pending — and its last start time. The Run button schedules the group for the next cron pass (it sets the group's "run once next" flag). The panel is only shown to users with the Cron permission (or global admins).

Running the Scheduler

The Syncer does not have a built-in scheduler daemon. Instead, call the run command periodically from your system cron — every 5 to 10 minutes is typical:

./cmdbsyncer cron run_jobs

Full example with environment activation:

*/5 * * * * cd /opt/cmdbsyncer && source ./venv/bin/activate && ./cmdbsyncer cron run_jobs

PyPI install (the cmdbsyncer binary lives inside the venv created by pip install cmdbsyncer; cd into the deployment directory so local_config.py is picked up):

*/5 * * * * cd /opt/cmdbsyncer && /opt/cmdbsyncer/venv/bin/cmdbsyncer cron run_jobs

If running from a different cwd is unavoidable (e.g. a system cron without cd), point the binary at the deployment directory explicitly:

*/5 * * * * CMDBSYNCER_CONFIG_DIR=/opt/cmdbsyncer /opt/cmdbsyncer/venv/bin/cmdbsyncer cron run_jobs

Docker:

*/5 * * * * docker exec CONTAINER_ID /srv/cmdbsyncer cron run_jobs

Docker Compose:

*/5 * * * * docker compose -f /opt/cmdbsyncer/docker-compose.yml exec -T cmdbsyncer /srv/cmdbsyncer cron run_jobs