Skip to content

Examples

The repository's examples guide lists the standalone scripts for job dependencies, artifacts, arrays, retrying failed work, async runs, Slurm, workflow manifests, and diagnosis. The script sources are shown by GitHub as code rather than downloaded as files.

Basic example

This example adds a direct command and a shell command through sh -c. From the repository root, run it with:

./examples/basic.sh

The script source on GitHub is included below for convenient browsing:

#!/usr/bin/env bash
set -eu

export ROTARI_PROJECT_NAME=basic-example

# Clear the next-run queue; completed run history is kept.
rotari reset

# A normal command, then a shell command using sh's -c option.
rotari add echo "hello from rotari"
rotari add sh -c 'echo "hello from a shell"'

# Run the queued jobs and wait for them to finish.
rotari run

# Show the latest run (or the queue if no run has completed).
rotari show

echo "Inspect this project later with: rotari show -p $ROTARI_PROJECT_NAME"