Skip to main content

Cron-style scheduler service for runspec runnables installed in one venv

Project description

runspec-scheduler

Cron, but limited to runspec runnables installed in one venv.

A long-running per-venv scheduler daemon (systemctl --user) that runs runnables installed in its own venv on a cron/interval cadence — independent of any desktop console. It is itself a runspec runnable, so runspec-console can detect it and manage its schedules over SSH, but discoverable = false keeps it out of the Forms tab / runspec serve MCP surface.

Why

A console-driven schedule only fires while the desktop console is open, and it's per-operator. runspec-scheduler gives you shared, always-on schedules that live on the host and run whether or not a console is connected.

Install

# Into the same venv whose runnables you want to schedule:
pip install runspec-scheduler

# Install + enable the systemd --user service for this venv:
runspec-scheduler install-service
loginctl enable-linger "$USER"     # survive logout

install-service writes ~/.config/systemd/user/runspec-scheduler-<venv>.service (one daemon per venv) and runs systemctl --user enable --now. To do it by hand, see deploy/runspec-scheduler.service.

Use

runspec-scheduler add --id nightly --runnable backup --cron '0 2 * * *'
runspec-scheduler add --id poll   --runnable healthcheck --every 15m --args '{"level":"warn"}'
runspec-scheduler list
runspec-scheduler run-now --id poll
runspec-scheduler remove --id poll
  • Exactly one of --cron (5-field cron) or --every (15m / 1h / 1d).
  • --args is a JSON object passed to the target runnable.
  • Adding/removing a schedule hot-reloads the running daemon (mtime poll, ≤ 5s).

Config

Schedules live in {venv}/runspec_scheduler.toml (override with --config or $RUNSPEC_SCHEDULER_CONFIG). The daemon keeps a rotating audit log at {venv}/logs/scheduler.log; live logs via journalctl --user -u runspec-scheduler-<venv> -f.

Credentials (run_as runnables)

runspec-console can attach service-account credentials to a remote schedule. For a runnable that declares run_as, the selected credentials are written to a 600 env file owned by the run_as account in that account's home; the daemon points RUNSPEC_ENV_FILE at it and escalates to run_as when firing. Credentials are never placed on a command line. This requires the daemon/SSH user to have passwordless sudo -u <run_as> (the same precondition as running that run_as runnable at all).

Runnables without run_as run as the daemon's own user with the daemon's environment (systemd EnvironmentFile) — no console credential injection.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

runspec_scheduler-0.1.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

runspec_scheduler-0.1.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file runspec_scheduler-0.1.0.tar.gz.

File metadata

  • Download URL: runspec_scheduler-0.1.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for runspec_scheduler-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ca222fe3f2cc751c92188d570c0a9b9d32b0d066617300dc728f7c4c7b6a10e4
MD5 025cedd2210e3a895802be65d562ee68
BLAKE2b-256 fed4c9beb39933839979df3e720813235c435bfaba94c42aec2c4aea263b7168

See more details on using hashes here.

Provenance

The following attestation bundles were made for runspec_scheduler-0.1.0.tar.gz:

Publisher: scheduler-release.yml on JasonFinestone/runspec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file runspec_scheduler-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for runspec_scheduler-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83d37919e3d6af6c6717e1f69e1f38d9d8ae52eea10ba4f5273322e47f6d5e9b
MD5 3604c66f74a3ec2d5f895229bc728071
BLAKE2b-256 29ac1c44602e9595f6c1627c800e893be3ecccc31b353ac54b55f5aabcaeb43a

See more details on using hashes here.

Provenance

The following attestation bundles were made for runspec_scheduler-0.1.0-py3-none-any.whl:

Publisher: scheduler-release.yml on JasonFinestone/runspec

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page