lazydns

Cron Plugin

The cron plugin runs scheduled background jobs inside the server process. It supports simple interval jobs and cron-expression schedules, and can perform HTTP requests, shell commands, or invoke other plugins programmatically.

Purpose of this Plugin

Imageing you want a tiny, standalong deploy without external cron dependencies, but need to run periodic tasks such as: refresing domain/ip rules, pinging health endpoints, rotating logs, or invoking lightweight plugin actions. The cron plugin provides a flexible way to schedule and run such tasks within the lazydns server process.

Yep, i ran lazydns inside a container on a router(ROS), and it’s all in one image only 7MB, the cron plugin did a good job with downloader plugin, fetching rules from github everday and the auto_load feature did the rest. Not extra cron setup needed.

Key features

Configuration

Top-level args contain a jobs sequence. Each job supports:

Example configuration

plugins:
  - tag: cron
    type: cron
    config:
      jobs:
        - name: ping_local
          interval_seconds: 60
          action:
            http:
              method: GET
              url: http://127.0.0.1:8080/health

        - name: refresh_cache
          cron: "0 */6 * * *" # every 6 hours
          action:
            invoke_plugin:
              type: cache
              args:
                size: 100

        - name: rotate_logs
          interval_seconds: 3600
          action:
            command: "logrotater --rotate"

Scheduling details

Behavior and lifecycle

Logging & troubleshooting

Best practices

See also