Running a set of asadmin subcommands from a file enables you to automate repetitive tasks.
Create a plain text file that contains the sequence of subcommands that you want to run.
Run the multimode(1) subcommand, specifying the file that you created.
If necessary, also specify any asadmin utility options that are required to enable subcommands in the file to run.
This example contains the following:
A listing of a file that is named commands_file.txt, which contains a sequence of asadmin subcommands
The command to run the subcommands in the file commands_file.txt
The commands_file.txt file contains the asadmin utility subcommands to perform the following sequence of operations:
Creating the domain customdomain
Starting the domain customdomain
Listing all available subcommands
Stopping the domain customdomain
Deleting the domain customdomain
The content of the commands_file.txt file is as follows:
create-domain --portbase 9000 customdomain start-domain customdomain list-commands stop-domain customdomain delete-domain customdomain
This example runs the sequence of subcommands in the commands_file.txt file. Because the --portbase option is specified for the create-domain subcommand in the file, the --port asadmin utility option must also be set.
asadmin --port 9048 multimode --file commands_file.txt |
For more information about the subcommands in the preceding example, see the following help pages: