👷 Background Jobs¶
Some actions need to run continuously, such as running the API or syncing pipes in a loop. Rather than relying on systemd
or cron
, you can use the built-in jobs system.
👔 Jobs¶
All Meerschaum actions may be executed as background jobs by adding -d
or --daemon
flags or by prefacing the command with start job
. New jobs will be given random names, and you can choose to specify a label with --name
.
1 |
|
Starting Jobs¶
Start a previous job by typing its name after start job[s]
:
1 |
|
Stopping Jobs¶
Stop a running job with stop job[s]
:
1 |
|
You can stop and remove a job with delete job[s]
:
1 |
|
⏲️ Schedules¶
You can run any command regularly with the flag -s
or --schedule
― for example, -s hourly
will execute the command once per hour. You can also specify a specific interval, e.g. -s 'every 10 seconds'
. Here are a few of the supported frequencies:
every N [seconds | minutes | hours | days]
hourly
daily
monthly
daily starting 12:00
monthly starting 6th
Here is the complete documentation for the interval syntax.
1 |
|
🪵 Logs¶
You can monitor the status of jobs with show logs
, which will follow the logs of running jobs.
1 |
|
You can attach to specific jobs by listing their names:
1 |
|
You can get a plain printout by adding --nopretty
:
1 |
|