Skip to content

Scripts and Scheduling

Paco5687 edited this page Jul 13, 2026 · 1 revision

Scripts & Scheduling

Store reusable scripts on the hub and run them on any host on demand or on a cron schedule. Every run is recorded with its output and exit code.

Requires the hub's history database (on by default; set with --db).

From the dashboard (📜 Scripts)

  1. Click 📜 Scripts in the top bar.
  2. New script → give it a name, pick a shell (sh, bash, powershell, cmd, or default), and paste the script body. Save.
  3. Run it: pick a host from the dropdown and click Run — the output appears inline.
  4. Schedule it: enter a cron expression and click Schedule on host.
  5. Browse Schedules and Recent runs at the bottom of the panel.

From the CLI

# create a script (body from stdin or a file)
echo 'apt list --upgradable' | autormm-client script add --name upgrades --shell bash

autormm-client script run upgrades <host>            # run now, prints output
autormm-client script schedule upgrades <host> '0 6 * * *'   # daily at 06:00
autormm-client script runs --host <host>             # run history
autormm-client script list          # all scripts
autormm-client script schedules     # all schedules
autormm-client script rm <script>   # delete a script
autormm-client script unschedule <id>

Cron format

Standard 5-field cron (minute hour day-of-month month day-of-week), evaluated with one-minute granularity:

Expression Runs
* * * * * every minute
*/15 * * * * every 15 minutes
0 6 * * * every day at 06:00
0 3 * * 0 Sundays at 03:00

Security & auditing

Scripts run as the agent's user, gated by the admin token. Each execution — manual or scheduled — is logged on the hub as an AUDIT script line with the script name, host, source, and exit code. Disable execution on a host with --allow-exec=false.

Clone this wiki locally