Using a Script with the Administration Utility
The Administration Utility can execute a series of commands from a script file. This is useful if you want to automate or standardize administrative actions through the use of a script instead of manually executing commands through the Administration Utility or by using Spectrum Management Console.
-
Using a text editor, create a script file. A script file contains the commands
that you want to execute.
To add a command to a script file, type the command and the necessary parameters as you would if you were entering the command at the command prompt. Enter one command for each line.
To insert comments into a script file, use the following notation:
/*
- Indicates the start of a block comment.
*/
- Indicates the end of a block comment.
//
- Indicates an inline comment. Use at the start of a line only.
;
- Indicates an inline comment. Use at the start of a line only.
- Save the script either on the computer where you run the Administration Utility or in a location that is accessible from the computer where you run the Administration Utility. You can use any file name and extension you choose. The recommend file extension is .cli.
-
To execute the script, do one of the following:
Option Description To execute the script at the command line Specify the following at the command line or in a batch or shell script:
cli.cmd --cmdfile ScriptFile
To execute the script from the Administration Utility Open the Administration Utility and connect to the Spectrum Technology Platform server using the connect command. Then, use the script command to execute the script. For more information on this command, see system_script.dita.
Example: Moving Dataflows from Staging to Production
You have three dataflows: Deduplication, AddressValidation, and DrivingDirections. You have a staging server where you make changes to these dataflows and test them, and a production environment where the dataflows are made available for execution. You want to have a consistent and automated way to move these dataflows from your staging server to your production server so you decide to use an Administration Utility script to accomplish this. The script might look like this:
// Connect to the staging server
connect --h stagingserver:8080 --u allan12 --p something123
// Export from staging
dataflow export --d "Deduplication" --e true --o exported
dataflow export --d "AddressValidation" --e true --o exported
dataflow export --d "DrivingDirections" --e true --o exported
// Close connection to the staging server
close
// Connect to the production server
connect --h productionserver:8080 --u allan12 --p something123
// Import to production
dataflow import --f exported\Deduplication.df
dataflow import --f exported\AddressValidation.df
dataflow import --f exported\DrivingDirections.df
// Close the connection to the production server
close