This topic explains how to create and run command scripts using gfsh
, the Tanzu GemFire command-line.
gfsh
offers several ways to run commands in a scripting environment.
You can create and run scripts that contain gfsh
commands that you wish to execute. To execute the script, use the gfsh
run command. For example:
gfsh run --file=mycommands.gfsh
When you run a gfsh
script, interactive parameters are ignored. You can also set the script to run in quiet mode to prevent output and instruct the script to skip any errors.
You may find your command history file to be helpful when you write a gfsh
script. A history of commands that have been executed successfully is logged in the .gfsh.history
file in the home directory of any user running gfsh
. You can also export a history file with the history --file=your_file_name
command.
When a user runs start server
or start locator
from gfsh
without specifying the member name, gfsh
automatically uses a randomly selected member name. Use this for automation.