Source:SBC CLI
Redirect page
Redirect to:
Copyright © SEP AG 1999-2024. All rights reserved.
Any form of reproduction of the contents or parts of this manual is allowed only with the express written permission from SEP AG. When compiling and designing user documentation SEP AG uses great diligence and attempts to deliver accurate and correct information. However, SEP AG cannot issue a guarantee for the contents of this manual.
Overview
Introducing the SEP sesam CLI
The SEP sesam command line interface (CLI) is a utility that provides an alternate way of executing SEP sesam commands in UNIX and Windows environments. It is used to install and configure a SEP sesam environment automatically without a GUI.
The CLI supports most of the commands that are available in the SEP sesam GUI. In addition, you can create, modify or delete SEP sesam objects and generate reports (lists) in different output formats. The CLI may be called from operating system batch files. Every CLI command (except a native SQL statement) checks and follows the internal structure and dependencies of the SEP sesam database.
Key features
- Automatically configure SEP sesam environments after installation (e.g., on implementation)
- Change the SEP sesam configuration without using the SEP sesam GUI
- Script-based mass installation and configuration (e.g., provider environment)
- Operate tests for installation and configuration in SEP sesam environments
- Get SEP sesam status, log and version information
- Determine SEP sesam object information for further use in other programs
CLI usage recommendations
- SEP sesam's optional command line commands are written directly to the SEP sesam database. Therefore all command line entries should be checked and verified!
- SEP sesam executes the commands immediately the <Enter>/<Return> key is pressed, which means that entries cannot be corrected, as is the case with the SEP Sesam GUI.
Note | |
It is extremely important that you are familiar with CLI and use it cautiosly in order not to cause a system failure of the backup environment. An erroneous entry can lead to complete data loss or other damage to the database. Such mistakes can void the warranty of your SEP sesam licensing agreement. |
- Before you start scripting with the SEP Sesam CLI, you should familiarize yourself with the SEP sesam environment. Read the SEP sesam documentation carefully and work on the SEP sesam installation to understand how the SEP sesam objects work together. Have a look at a SEP Sesam CLI example for the creation of a new SEP sesam environment by SEP sesam CLI. Only after becoming familiar with SEP sesam should you attempt to use the CLI and write your first scripts.
Command conventions
The parameters for a command are order-dependent and might include mandatory and optional values, or keyword choices.
- < > arrow heads
- Indicates required or expected values.
- | vertical bar
- Separates the choices between two or more options or arguments.
- [ ] square brackets
- Indicates optional values.
CLI reference
CLI main call
Usage:
sm_cmd <server-options> <command> <object> <options>
Server options:
-S <server> SEP sesam server to connect to -p <port> RMI port of server -f <path of command file> read commands from file -v <loglevel> loglevel -h print help usage
Available commands:
add modify remove help list the options for a specific command list show <license|version|calendar|current> show log <sesam|error|state|disaster|notify|alarm> start
Commands for drive only:
mount dismount unload
Commands for loader only:
import export unload load
Objects:
backup client command commandevent datastore drive drivegroup interface inventory loader loaderdevice location mailaccount mail media mediapool mediapoolevent migration migrationtask migrationevent notification restart restore restoreevent restoretask schedule task taskevent taskgroup taskgrouprelation update
Example:
sm_cmd -v 2 add task barometrix_etc -c barometrix.sep.de -s /etc
Output:
2009-08-17 16:36:53 INFO - Sesam GUI V3.6 Build 1 A 1.5511 2009-08-17 08:23:24 2009-08-17 16:36:53 INFO - set level to 'INFO' 2009-08-17 16:36:53 INFO - logging to console started. 2009-08-17 16:36:53 INFO - Server set to smsrv 2009-08-17 16:36:53 INFO - set port to '11401' 2009-08-17 16:36:53 INFO - set loglevel: 2 2009-08-17 16:36:53 INFO - CLI: CliService is available 2009-08-17 16:36:53 INFO - sm_gui_request"test.jvr"null"S"sm_setup"get_policy " 2009-08-17 16:36:53 INFO - SesamRemoteShell.callRemoteShell(0) commandString='sm_gui_request"test.jvr"null"S"sm_setup"get_policy "' 2009-08-17 16:36:53 INFO - Authentificate User 'root' 2009-08-17 16:36:53 INFO - CLI: -S smsrv -p 11401 -v 2 add task MucEsc01_etc -c MucEsx01 -s /etc 2009-08-17 16:36:53 INFO - DB SQL: 'SELECT * FROM clients WHERE name='MucEsx01 2009-08-17 16:36:53 EXEC - DB SQL: 'INSERT INTO tasks (backup_type, client_id, source, prepost, r_prepost, crypt_flag, task) VALUES ('Path','2','/etc','nnnn','nnnn','0','MucEsc01_etc')' STATUS=SUCCESS MSG="MucEsc01_etc"
All INFO messages are written to standard error. They can be suppressed by redirecting stderr to /dev/null.