Skip to content

com.limdm.scripts (list)

Console: Recurring scripts.

{"scripts": [{"name": "cleanup", "interval_hours": 24, "body": "#!/bin/sh\njournalctl --vacuum-time=$KEEP",
              "params": {"KEEP": "30d"}, "timeout_minutes": 10},
             {"name": "report", "schedule": {"times": ["02:00"], "days": ["mon", "thu"], "jitter_minutes": 30},
              "run_on_change": true, "body": "#!/bin/sh\n/usr/local/bin/report"}]}
Field Type Rules
scripts[].name text lower case letters, digits, ., _, -
scripts[].interval_hours number 1 to 720; absent (0) with a schedule
scripts[].schedule.times list of text local HH:MM of the device, 1 to 24, each once
scripts[].schedule.days list of text mon … sun; empty is every day
scripts[].schedule.jitter_minutes number 0 to 120
scripts[].run_on_change true or false also run once when body, params or timeout change
scripts[].body text up to 64 KiB
scripts[].params object of text environment variables: up to 50, names of letters, digits and _, values up to 4096 characters, 32 KiB in total
scripts[].timeout_minutes number 1 to 240; 0 or absent means 30

Merged by name. Recurring root scripts run only on devices enrolled with allow_scripts; elsewhere the declaration is reported as failed. Reserved variable names are refused: PATH, IFS, HOME, SHELL, ENV, BASH_ENV, SHELLOPTS, BASHOPTS, PS4, CDPATH, GLOBIGNORE, TMPDIR, interpreter paths (PYTHONPATH, PERL5LIB, NODE_OPTIONS and similar) and everything starting with LD_, LC_ or DYLD_. Each run is reported to the server with exit code, start, end and the last 16 KiB of stdout and stderr, and shown under Script results on the device page. While the device is offline it keeps the last 50 results.

A script runs either every interval_hours (the first time right after it is declared) or on a schedule. A scheduled script runs at most once per slot: at the first agent loop after the slot time plus the jitter. A slot missed while the device was off or asleep runs once at the next chance; several missed slots collapse into one run. A new schedule waits for its next slot. The jitter is a fixed delay per device and script (a hash of both), so a fleet spreads over the jitter window but each device keeps its own time. run_on_change runs the script once more when its body, params or timeout change, the first declaration included. Agents before 0.19 reject schedule and run_on_change as unknown keys and report the declaration as invalid instead of running the script. The item editor shows the last run per device (GET /api/v1/config/scripts/results?name=).

Field reference

Generated from the payload schema of the server (GET /api/v1/schemas/{type}), the same reference the console editor shows. Unknown fields are rejected.

com.limdm.scripts

Console: Recurring scripts. Shell scripts the agent runs as root on an interval.

Field Type Meaning Limits
scripts list of object Scripts
scripts[].name string Name
scripts[].interval_hours integer Interval (hours) 1 to 720; empty with a schedule. min 1; max 720
scripts[].body string Script Runs as root; start with a shebang such as #!/bin/sh.
scripts[].params map of string Environment Environment variables for the script.
scripts[].timeout_minutes integer Timeout (minutes) 1 to 240, 30 when empty. max 240
scripts[].schedule object Schedule Fixed local times instead of the interval (leave the interval empty); at most one run per slot, a missed slot runs once at the next chance.
scripts[].schedule.times list of string Times HH:MM in the device's local time, up to 24.
scripts[].schedule.days list of string Weekdays Empty means every day. one of "mon" (Mon), "tue" (Tue), "wed" (Wed), "thu" (Thu), "fri" (Fri), "sat" (Sat), "sun" (Sun)
scripts[].schedule.jitter_minutes integer Jitter (minutes) A fixed delay per device, 0 to 120, so the fleet does not start at once. min 0; max 120
scripts[].run_on_change boolean Run on change Also run once whenever the script, its environment or timeout change.
Example payload
{
  "scripts": [
    {
      "name": "cleanup",
      "interval_hours": 24,
      "body": "#!/bin/sh\njournalctl --vacuum-time=30d"
    }
  ]
}