Topics | QCommands | Save As Script | XML Scripts | QScripts | QAPI Developers Guide | How To | Troubleshoot | Support | Related Topics
Operations Supported by Save As Script
Several operations enable you to pick the options from the CommCell Console and save them as script files using the Save As Script option. These scripts are saved to the specified location in .xml format and can later be executed from the command line interface using the qoperation execute command.
For step-by-step instructions on saving a job as script, see Save a Job as a Script.
For step-by-step instructions on executing a script using qoperation execute command, see Execute Scripts using qoperation execute Command.
The Save As Script feature is currently supported for all operations that can be scheduled from the CommCell Console. For supported options, see Operations Supported by Save As Script.
During Data Protection, Recovery, Auxiliary Copy, Disaster Recovery Backup, or Data Aging operations, you can select the options and save them as a script using the Save As Script option from the CommCell Console. The Save As Script option generates two files: .bat and .xml.
The .bat file contains the following commands:
The .xml file is the script file that contains information on the options selected from the CommCell Console. This .xml file is given as input to the qcommand execute in the batch file.
When saving the script, if the file name already exists, the batch file is overwritten whereas the .xml file is saved with a timestamp on the file name.
The batch file can be executed in two modes:
Users can now save the job options as Save As Script in a local folder on a client machine. They can enter their credentials and provide the destination path on client machine to which they want to save the file.
Once the script is generated, you can remove or modify the parameters in the script in the following way:
Qoperation execute –af a.xml -parameter value
Here, the value for the parameter name gets replaced. If the parameter occurs multiple times in the .xml then all the fields with that parameter name gets replaced. If only one parameter needs to be modified, you need to specify it as parent/node (i.e. the X Path).
When running the batch file in the command prompt, you can also set any parameter from the generated XML file in the following format:
myscript.bat -parameter value
The above syntax allows you to update specific XML parameters. Any parameter that you define in the command prompt when running the batch file will be passed into the generated XML file.
Consider the following before you save a job as a script:
You can also save a script remotely.
To save the script on a remote computer, you must enter the path and file extension. For e.g., .bat, .sh, etc.A save a job as script file can run as a pre/post process only if you include the absolute path of the associated input file in the script file. Therefore, be sure to include this path in the script file.
When you save an operation as a script, each option in the dialog will have a corresponding xml parameter in the script file. When executing the script, you can modify the value for any of these XML parameters as per need.
The following table indicates all the operations supported by Save As Script.