Example: Creating a Pre- or Post-Process Script

You can configure the subclient to run a program before a backup starts or after it completes. The pre- and post-process programs execute as a Qshell command, so you must follow the Qshell syntax.

Procedure

  • Configure a program that suspends an application or a sub-system. The backup processes the data in a consistent state.

The program must accept four or more arguments where the first four arguments are required and always are passed to the process as Job ID, Job Attempt, Backup Level, and Job Status. The software retrieves the remaining arguments from the CommCell Console.

The program must send a Complete message to indicate successful completion. The backup job moves to the next phase only when it receives the Complete message. If it does not receive the Complete message, the job remains in a suspended state.

Parameter

Description

MYLIB

This is a library name.

PREPROGRAM

The program name.

argA, argB

These represent arguments.

MYLIB/PREPROGRAM argA argB

The script runs as:

CALL PGM(MYSCRPT/PRESCRIPT) PARM(JOBID ATTEMPT BKPLVL STATUS ARGA ARGB)

Example

This is a command line program that receives 6 arguments. The last 2 arguments (ARG1, ARG2) are passed from the CommCell Console.

PGM PARM(&JOBID &ATTEMPT &BKPLVL &JOBSTAT &ARG1 &ARG2)
 DCL VAR(&JOBID) TYPE(*DEC) LEN(15 5)
 DCL VAR(&ATTEMPT) TYPE(*DEC) LEN(15 5)
 DCL VAR(&BKPLVL) TYPE(*DEC) LEN(15 5)
 DCL VAR(&JOBSTAT) TYPE(*DEC) LEN(15 5)
 DCL VAR(&ARG1) ...
 DCL VAR(&ARG2) ...
 /* Program Code Begin */
 /* Program Code End */
 /* Notify success */
 SNDPGMMSG MSG('Complete')
 ENDPGM

Loading...