10400455-002
©2008-14 Overland Storage, Inc.
272
SnapScale/RAINcloudOS 4.1 Administrator’s Guide
E - Command Line Interface
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.
•
Be sure to use an application that is compatible with the standard Unix text file
format (for example, 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.
Logging into SnapCLI on page 267
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 Overland Storage, Inc. All rights reserved. #
# Permission is granted to use this code provided that it #
# retains the above copyright notice. ##
##########################################################
CLI=/bin/cli
USER=myuser
PASSWORD=myuserpass
GROUP=mygroup
volume delete
Delete a logical volume
volume edit
Edit an existing logical volume
volume get
Get a specific volume’s properties
volume list
List of the volumes defined on the SnapScale cluster
volume write-cache
Enable or disable write cache on a volume.
web get
Get current HTTP Web access settings
web set
Enable or Disable HTTP access to Web Management
Interface
windows domain-filter
Allows the user to limit the number of domain users and
groups that the server imports from the Active Directory
domain, by restricting the import to a specific organizational
unit as well as to specific domain users and groups.
Command
Description