Scripts in SnapCLI
154 Snap Server Administrator Guide
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 <user_name> <password>'
mkuser()
{
Summary of Contents for 5325301656 - Snap Server 14000 NAS
Page 2: ......
Page 76: ...Disks and Units 62 Snap Server Administrator Guide ...
Page 92: ...Creating iSCSI Disks 78 Snap Server Administrator Guide ...
Page 108: ...Security Guides 94 Snap Server Administrator Guide ...
Page 144: ...Unicode and Expansion Arrays 130 Snap Server Administrator Guide ...
Page 164: ...Off the Shelf Backup Solutions for the Snap Server 150 Snap Server Administrator Guide ...
Page 172: ...Scripts in SnapCLI 158 Snap Server Administrator Guide ...