⏯️ Actions¶
To see available actions, run help or show actions.
Add -h to a command or preface with show help to learn more.
Custom actions
Use the @make_action decorator to make your scripts into custom actions.
Actions are commands for managing your Meerschaum instance and are a great way to perform bulk operations.
Syntax¶
Actions follow a simple verb-noun syntax (singular or plural):
1 2 3 4 5 6 7 | |
Run mrsm (python -m meerschaum) to execute actions from the Meerschaum shell:
1 2 | |
Or run actions directly from the command line:
1 | |
Chaining Actions¶
Join actions with + to run them in a single process (similar to && in bash):
1 2 | |
Flags added after : apply to the entire pipeline:
1 2 3 4 | |
You can escape
:with::, e.g.mrsm echo ::will output:.
Here are some useful pipeline flags:
--loop
Run the pipeline commands continuously.--min-seconds(default1)
How many seconds to sleep between laps (if--looporx3).-s,--schedule,--cron
Execute the pipeline on a schedule.-d,--daemon
Create a background job to run the pipeline.x3,3
Execute the pipeline a specific number of times.
Note that you can add : to single commands as well:
1 | |
Daemonize Actions¶
Add -d to any action to run it as a background job.
1 | |
This works well when chaining actions to create a pipeline job:
1 2 | |
bash Actions¶
Any bash command may be run as an action. This is a great way to run shell scripts through Meerschaum.
1 | |