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

Page 16

Advertising
background image

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 <filename>

Where

<filename>

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

Advertising