Using an input file to execute a script, Scripting examples – Avago Technologies 3ware SAS 9750-16i4e User Manual
Page 16

Chapter 1. Introduction to the 3ware Command Line Interface
8
3ware SATA+SAS RAID Controller Card CLI Guide, Version 10.2
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 that you have entered in advance. Each
command must be on a separate line.
Syntax
tw_cli -f
Where
is the name of the text file you want to execute.
Example
tw_cli -f clicommand.txt
This example describes execution of the file
clicommand.txt
, which runs the
CLI commands included in that file.
Scripting examples
The following scripting example, which is for a four-port controller, uses a
text file called config_unit.text that contains three commands. This example
sets up a four-port controller with two units, each with two drives mirrored.
The last command then prints the configurations for verification. The
following commands are included in the script file:
/c0 add type=raid1 disk=0-1
/c0 add type=raid1 disk=2-3
/c0 show
The following scripting example, which is for a 12-port controller, uses a text
file called config_unit.text that contains three commands. This example sets
up a 12-port controller with two units: one with the first two drives mirrored,
and another with the remaining drives in a RAID 5 array. The last command
then prints the configurations for verification. The following commands are
included in the script file:
/c0 add type=raid1 disk=0-1
/c0 add type=raid5 disk=2-11
/c0 show
To run either of the scripts, type:
tw_cli -f config_unit.txt
- 3ware SAS 9750-24i4e 3ware SAS 9750-4i 3ware SAS 9750-4i4e 3ware SAS 9750-8e 3ware SAS 9750-8i 3ware 8006-2LP 3ware 8006-2LP (Channel) 3ware 9550SXU-4LP 3ware 9550SXU-4LP (Channel) 3ware 9550SXU-8LP 3ware 9550SXU-8LP (Channel) 3ware 9650SE-12ML 3ware 9650SE-12ML (Channel) 3ware 9650SE-16ML 3ware 9650SE-16ML (Channel) 3ware 9650SE-24M8 3ware 9650SE-24M8 (Channel) 3ware 9650SE-2LP 3ware 9650SE-2LP (Channel) 3ware 9650SE-4LPML 3ware 9650SE-4LPML (Channel) 3ware 9650SE-8LPML 3ware 9650SE-8LPML (Channel) 3ware 9690SA-4I 3ware 9690SA-4I (Channel) 3ware 9690SA-4I4E 3ware 9690SA-4I4E (Channel) 3ware 9690SA-8E 3ware 9690SA-8E (Channel) 3ware 9690SA-8I 3ware 9690SA-8I (Channel)