Skip to content

Background Jobs

Add -d to run an action in the background. Give it a name so you can find its logs later:

mrsm sync pipes --loop --name syncing-engine -d
mrsm show jobs
mrsm show logs syncing-engine

Jobs keep running after your terminal closes. Their executor determines where they run and whether they return after a reboot.

Manage a job

Command Effect
mrsm start jobs syncing-engine Start it.
mrsm pause jobs syncing-engine Suspend it.
mrsm stop jobs syncing-engine Stop it.
mrsm delete jobs syncing-engine Stop it and remove its definition.
mrsm attach job syncing-engine Follow output and answer prompts.
mrsm show logs syncing-engine Follow output without sending input.

The console's Jobs page offers the same controls. It also shows when the job last ran and its health.

Choose what happens next

Need Guide
Run every hour or on a calendar Schedules
Run locally, with systemd, or on another server Executors
Understand who can see or control a job Access
Find temporary console executions Automatic Runs
Diagnose a repeating job Health
Start many workers without a resource spike Startup stagger
Manage jobs from Python
import meerschaum as mrsm

job = mrsm.Job('syncing-engine', 'sync pipes --loop')
success, message = job.start()
print(job.health)
job.stop()

See the full Job API.