MMG Scheduler Shell Utility (mmg_scheduler.sh)
mmg_scheduler.sh utility provides a
command-line interface to trigger and monitor OFS MMG batches or batch group
executions. Use this utility to:
- Trigger an immediate batch or batch group execution by name.
- Include, exclude, or hold certain selected tasks within the execution.
- Optionally, specify custom batch parameters.
- Query the execution status of any batch or batch group by using its run ID.
- Monitor the progress automatically (auto-follow) or check its status as needed.
The mmg_scheduler.sh utility can be found in
OFS_MMG/bin.
General Syntax
./mmg_scheduler.sh [core options] [mode options] [execution options]
[monitoring options]
- trigger — Starts a batch or batch group execution.
- status — Queries status of an existing run using its run ID
Core Options (Required for Most Commands)
- -u <USER>: MMG user identifier
- -w <WORKSPACE>: Workspace name
- -c <CLIENT_ID>: client ID
- -s <CLIENT_SECRET>: client secret
- -B <BASE_URL>: MMG base URL (for
example:
"https://<MMG_SERVICE_HOST>:<MMG_GATEWAY_PORT>/<WEB_CONTEXT>/")
- Triggering Execution
- Trigger a Batch
(Default)
./mmg_scheduler.sh -m trigger -b <BATCH_NAME> -u <USER> -w <WORKSPACE> -c <CLIENT_ID> -s <CLIENT_SECRET> -B "https://<MMG_SERVICE_HOST>:<MMG_GATEWAY_PORT>/<WEB_CONTEXT>/"Example
./mmg_scheduler.sh -m trigger -b Batch_Model1 -u mmgadmin -w CS -c ofsauser -s secret -B "https://<MMG_SERVICE_HOST>:<MMG_GATEWAY_PORT>/<WEB_CONTEXT>/"
- Trigger a Batch Group
Use -t group to indicate that the name provided with -b is a batch group:
./mmg_scheduler.sh -m trigger -b <BATCH_GROUP_NAME> -t group -u <USER> -w <WORKSPACE> -c <CLIENT_ID> -s <CLIENT_SECRET> -B "https://<MMG_SERVICE_HOST>:<MMG_GATEWAY_PORT>/<WEB_CONTEXT>/"Example
./mmg_scheduler.sh -m trigger -b Batch_Group1 -t group -u mmgadmin -w CS -c ofsauser -s secret -B "https://<MMG_SERVICE_HOST>:<MMG_GATEWAY_PORT>/<WEB_CONTEXT>/"
- Trigger a Batch
(Default)
Table 12-7 Additional Options Supported by the mmg_scheduler.sh Utility
| Option | Usage |
|---|---|
| Customize Task Execution | Include, Exclude, or Hold
specific tasks:
The |
| Pass Custom Parameters | Use the following option to
pass custom parameters:
Use -v to pass a
JSON payload to specify:
Example
|
| Monitoring & Polling Options |
|
| Filter status by individual tasks | Use this to filter the status
for individual selected tasks:
This filter is only applicable for the status option. Example
|
- Querying the Status by Run ID
Use -m status and provide the run ID by using -r.
-
Syntax
./mmg_scheduler.sh -m status -r <BATCH_RUN_ID> -u <USER> -w <WORKSPACE> -c <CLIENT_ID> -s <CLIENT_SECRET> -B "https://<MMG_SERVICE_HOST>:<MMG_GATEWAY_PORT>/<WEB_CONTEXT>/" -
Example
./mmg_scheduler.sh -m status -r Batch_RunID_12345 -u mmgadmin -w CS -c ofsauser -s secret -B "https://<MMG_SERVICE_HOST>:<MMG_GATEWAY_PORT>/<WEB_CONTEXT>/"
-
Help/Usage Information
To display the list of supported options and usage examples, run:
./mmg_scheduler.sh --help
Authentication
The script requires valid OFS MMG credentials (client ID or secret), workspace, and user identity, as it has been configured in your OFS MMG deployment.
Typical Workflow
- Trigger a batch or group job. This will return the batch run ID.
- Auto-follow or manually follow and monitor the batch or batch group status. This will return the task or batch progress and results in real time.
- Optional, you can re-query the job status any time by using the batch run ID.
Handling Errors
Errors are clearly reported for invalid credentials, unreachable APIs or servers, or invalid batches or run IDs. For failed tasks, status, and errors, they can be viewed in the command output.
- The default polling automatically times out after 20 seconds unless it has been overridden.
- Filtering and custom parameters support for batch groups might be limited.
- Always use the correct client ID or secret. These
values are configured in the OFS MMG UI
application.property file:
- aai.client.id
- aai.client.secret
In the application.property file under mmg-ui service, the secret may appear masked (because it is sensitive). If the actual value is not visible, contact your MMG administrator (or the team managing your deployment secrets) to obtain the correct client ID/secret.
- For failures or unexpected results, check the command output for error messages.