MMG Scheduler Shell Utility (mmg_scheduler.sh)

The 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]

The utility supports two main modes:
  • 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)

These options are typically required for both trigger and status calls:
  • -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>/"

The following table provides information on the additional options that are supported by this utility:

Table 12-7 Additional Options Supported by the mmg_scheduler.sh Utility

Option Usage
Customize Task Execution Include, Exclude, or Hold specific tasks:
  • -i TaskA,TaskB - Use this to include only specified tasks
  • -e TaskC - Use this to exclude specified tasks
  • -H TaskD -Use this to keep specified tasks on hold (not run in this execution)

The -i task will always take precedence over the -e and -H options

Pass Custom Parameters Use the following option to pass custom parameters:
Use -v to pass a JSON payload to specify:
  • batchParams: parameters applied at the batch level
  • taskRuntimeParams: task-specific parameters keyed by task name

-v '\{"batchParams":{"param1":"value"},"taskRuntimeParams":\{"Task1":{"param":"value"}}}'

Example

./mmg_scheduler.sh -m trigger -b Batch_Model1 -v '{"batchParams":{"param1":"value1"},"taskRuntimeParams":{"Task1":{"param":"value"}}}' -u mmgadmin -w CS -c ofsauser -s secret -B "https://<MMG_SERVICE_HOST>:<MMG_GATEWAY_PORT>/<WEB_CONTEXT>/"

Monitoring & Polling Options
  • --follow (default) - This option will poll the execution status automatically after being triggered.
    • Use -T <seconds> to adjust the auto-follow timeout. The default timeout value is 20 seconds.
    • Use -n <seconds> to change the polling interval. The default interval is 10 seconds.
  • --no-follow - Only triggers the batch and does not monitor its status.
Example: Trigger and follow for up to 10 minutes

./mmg_scheduler.sh -m trigger -b Batch_Group1 -t group -u mmgadmin -w CS -c ofsauser -s secret -B "https://<your-server>:<mmguiport>/mmg8133/" --follow -T 600 -n 10

Filter status by individual tasks Use this to filter the status for individual selected tasks:

-k TaskA,TaskB

This filter is only applicable for the status option.

Example

./mmg_scheduler.sh -m status -r Batch_RunID_12345 -k TaskA,TaskB -u mmgadmin -w CS -c ofsauser -s secret -B "https://<MMG_SERVICE_HOST>:<MMG_GATEWAY_PORT>/<WEB_CONTEXT>/"

  • 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

The following is the typical work flow of the utility:
  1. Trigger a batch or group job. This will return the batch run ID.
  2. 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.
  3. 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.

Notes and Limitations
  • 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.