Adaptec 5325301656 Administration Guide - Page 168
Scripts in SnapCLI, Running a SnapCLI Script, Sample Script
UPC - 753253016563
View all Adaptec 5325301656 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 168 highlights
Scripts in SnapCLI Scripts in SnapCLI Administrative tasks can be automated with shell scripts that call SnapCLI commands. Running a SnapCLI Script 1 Create the script and put it in a share on the local server. Notes • Be sure to use an application that is compatible with the standard UNIX text file format (e.g., vi). Avoid using Windows clients to create or edit scripts. • Place the script in a share that will never be part of a delete script. 2 Log in to the SnapCLI (see Logging into SnapCLI for instructions). 3 Type osshell to get a bash prompt. 4 At the prompt, make sure the script is executable by typing the following and pressing Enter: chmod +x/shares/[sharename]/[scriptname] where sharename is the name of the share where you put the script and scriptname is the name of the script. 5 To run the script, type the path again, and press Enter: /shares/[sharename]/[scriptname] Sample Script Following is an example script that can be used to create and remove users, groups, and shares: #!/bin/sh # Copyright 2003-2007 Adaptec, Inc. All rights reserved. # # Permision is granted to use this code provided that it # # retains the above copyright notice. ## CLI=/bin/cli USER=myuser PASSWORD=myuserpass GROUP=mygroup SHARE=myshare VOLUME=VOL0 # usage: 'mkuser ' mkuser() { 154 Snap Server Administrator Guide