
Working with 3ware CLI
Using a single command with output
You can use 3ware CLI with line arguments, processing a single command at a time. To do so, simply enter the command and the arguments.
Single commands can be useful when you want to perform a task such as redirecting the output of the command to a file. It also allows you to use the command line history to eliminate some typing.
Syntax
tw_cli <command_line_arguments>
Example
tw_cli /c0 show diag > /tmp/3w_diag.out
Using an input file to execute a script
You can operate 3ware CLI scripts by executing a file. The file is a text file containing a list of CLI commands which you have entered in advance. Each command must be on a separate line.
Syntax
tw_cli
Where <filename> is the name of the text file you want to execute.
Example
tw_cli
This example executes the file clicommand.txt, and runs the CLI commands included in that file.
Scripting example
Following is a scripting example using a text file called config_unit.txt, containing three commands. This example sets up a
/c0 add type=raid1
To run the script, enter:
tw_cli
www.3ware.com | 7 |