Working with 3ware CLI
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 a scripting example using a text file called config_unit.txt, containing three commands. This example sets up a
/c0 add type=raid1
Outputting the CLI to a Text File
You can have the output of the 3ware CLI, including errors, sent to a text file by adding 2>&1 to the end of the line. This could be useful, for example, if you want to email the output to AMCC Technical Support.
Examples
tw_cli /c2/p0 show >> controller2port0info.txt 2>&1
or
tw_cli /c0 show diag >> Logfile.txt 2>&1
www.3ware.com | 7 |