SEP Sesam CLI

From SEPsesam
Jump to: navigation, search

Copyright © SEP AG 1999-2017. 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.

Docs latest icon.png Welcome to the latest SEP sesam documentation version 4.4.3. For previous documentation version(s), check documentation archive.


Overview

SEP sesam provides both, GUI and CLI interfaces to manage SEP sesam environment (CLI) or individual client (SBC) in UNIX and Windows environments. SEP sesam command line interface provides two CLI components: administration utility SEP sesam CLI and client utility SBC CLI. The latter is used to back up and restore data locally on the host.

SEP sesam CLI administration utility is used to install and configure a SEP sesam environment automatically without a GUI. CLI commands enables administrators to access SEP sesam database and manage the whole SEP sesam environment, for example, to install, configure and manage SEP sesam servers and clients centrally without a GUI. Every CLI command (except a native SQL statement) checks and follows the internal structure and dependencies of the SEP sesam database.

Features

  • Automatic configuration of 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

Command conventions

The parameters for a command are order-dependent and might include mandatory and optional values, or keyword choices. Mandatory functions are designated by an asterisk (*).

| vertical bar
Separates the choices between two or more options or arguments.
[ ] square brackets
Indicate optional values.
< > angle brackets
Indicate that the enclosed element is mandatory.
Information sign.png Note
The commands are run in the command prompt from <SESAM_ROOT>/bin/sesam/.

Before you begin

SEP sesam CLI is a very powerful command line tool. You should be aware of its implications on your entire environment before you start using it.

Recommendations for using the SEP sesam CLI

  • 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. 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. Note that 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.
  • 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.
Information sign.png Note
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.

SEP sesam CLI usage

The use of the object items of the SEP sesam CLI are described below. Functions can be mandatory or optional. Mandatory functions are designated by an asterisk (*). There will be one or more examples on how to use the command at the end of each object section.

When building a new SEP sesam environment with the CLI, work in the same order as you would when using the SEP sesam GUI. Start with Topology objects, then create tasks and schedules, and finally connect the relevant events (e.g., backup, migration or command) to the schedules.

Attention: Global Deletion

Global deletion option enables you to delete a client or task and all dependent or related objects. This means that if you want to delete a client, you can delete all of its corresponding tasks at the same time. Deleting a task during this process removes it from its task groups and task events. Global deletion is available for clients and tasks. You can enforce global deletion by using the parameter -F YES. The string YES is for security. It verifies that the user actually wants to perform this task.

If a backup client is connected to a loader or drive, it cannot be deleted by Force parameter. First remove the loader or drive and then re-start the client/task deletion.

Syntaxes

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>               log level
   -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

Examples:

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.



Displaying SEP sesam DB data

The content of the SEP sesam DB for various actions can be displayed with the parameter list or sql.

Options:

  • -d: Delimiter \t = TAB (default)
  • -F: Output format (default: header)

Examples:

The delimiter parameter is only valid with specific formats. Some usage examples follow:

  • Output with column delimiter "|" (pipe) with different header

Command:

sm_cmd list locations -d "|"
sm_cmd sql "select * from locations" -d "|"

Output:

id|name|parent|describe|contact|comment
0|LOCAL|NULL|NULL|NULL|NULL

Command:

sm_cmd list locations -d "|" -F noheader
sm_cmd sql "select * from locations" -d "|" -F noheader

Output:

0|LOCAL|NULL|NULL|NULL|NULL

Command:

sm_cmd list locations -d "|" -F named
sm_cmd sql "select * from locations" -d "|" -F named

Output:

id=0|name=LOCAL|parent=NULL|describe=NULL|contact=NULL|comment=NULL|originalid=0|insert=false|update=false|delete=false

Here are some examples for the different format (-F) values:

  • Standard display without format parameter

Command:

sm_cmd list locations
sm_cmd sql "select * from locations"

Output:

id	name	parent	describe	contact	comment
0	LOCAL	NULL	NULL	NULL	NULL
  • Hide the column header

Command:

sm_cmd list locations -F noheader
sm_cmd sql "select * from locations" -F noheader

Output:

0	LOCAL	NULL	NULL	NULL	NULL
  • Display the column header in a special form (header=value)

Command:

sm_cmd list locations -F named
sm_cmd sql "select * from locations" -F named

Output:

id=0	name=LOCAL	parent=NULL	describe=NULL	contact=NULL	comment=NULL	originalid=0	insert=false	update=false	delete=false
  • Output the data as SQL DML command (insert)

Command:

sm_cmd list locations -F export
sm_cmd sql "select * from locations" -F export

Output:

INSERT INTO locations (id,name,parent,describe,contact,comment) VALUES (0,'LOCAL',NULL,NULL,NULL,NULL)

You can use this output to create datasets manually, e.g.

sm_db "INSERT INTO locations (id,name,parent,describe,contact,comment) VALUES (0,'LOCAL',NULL,NULL,NULL,NULL)"



Topology

Location

After the installation of a new SEP sesam Server, a standard location – named Local – is created. You can use this default location for adding clients or you can create your own locations as desired.

Usage:

  sm_cmd <add|modify|remove> location ID [OPTIONS...]
         If 'ID' is set to 'auto', SEP sesam will generate it automatically.

Options:

  -L   location name (* for ADD)
  -p   parent location
  -i   description
  -c   contact
  -j   comment

Locations can be created with a given or automatically generated ID. The given location ID must be unique.

  • Given ID: add location 3 <options...>
  • Auto ID: add location auto <options...>

Examples:

  sm_cmd add location 3 -L MUNICH
  sm_cmd add location auto -L SEP -p 3
  sm_cmd modify location 3 -L PARIS -j "main city of france"
  sm_cmd remove location 3

Client

The SEP sesam Server client object exists as soon as a new SEP sesam Server is installed. Your backup clients must be registered in the SEP sesam environment before they can be used. If you add clients with the SEP sesam GUI during the registration process, SEP sesam Server checks whether the client is visible or accessible. This is not so with the SEP sesam CLI; it is therefore recommended to check client availability by starting a small backup task after adding the client. For details on creating a backup task in GUI, see Standard Backup Procedure.

Usage:

  sm_cmd <add|modify|remove> client <hostname> [OPTIONS...]

Options:

  -L   location (default: 0)
  -o   operating system (* reference DB:oper_systems)
  -a   access mode <CTRL|SSH|RSH>
  -i   user comment
  -y   permit <y|n>
  -O   access options
  -r   stpd options
  -p   stpd port
  -F   <YES> remove all objects belonging to client too, this action is critical and must be confirm with the argument "YES".
  -V   server type

'NetWare' options:

  -d   datamover *
  -U   user name *
  -P   password *

'VMware vSphere' options:

  -V   <'vCenter'>
  -U   <user> vCenter user
  -P   <password> vCenter password
  -d   datamover

Examples:

  sm_cmd add client barometrix -o LINUX
  sm_cmd add client minus -o "Windows XP" -a CTRL -L 0
  sm_cmd modify client beifus -i "new comment" -o "LINUX"
  sm_cmd remove -F YES client BerLx01

Interface

The configuration of the interface is only necessary if you want to use a LAN-free backup or a SAN environment. Your backup server must have at least two network interface modules configured with different IP addresses and DNS names. You can then create an interface for every network interface you want to use. For more information, see SEP Sesam Admin Manual.

Usage:

  sm_cmd <add|remove> interface <interface name> [OPTIONS...]

Options:

  -c   clientname (*)

Examples:

  sm_cmd add interface buildfix.sep.de -c buildfix
  sm_cmd remove interface buildfix

Data store

The data store is SEP sesam's object for backup to disk. As with data store preparation in the SEP sesam GUI, all corresponding SEP sesam objects, such as drive group, drive and media pool, can be created in one step. For detailed information about the functionality, see SEP sesam data store.

Usage:

   sm_cmd <add|modify|remove> datastore <datastore name> [OPTIONS...]

Options:

Datastore parameter:
   -i   comment
   -c   <[0-9]*>  capacity  (in Gb)
   -l   <[0-9]*>  low_water_mark  (in Gb)
   -h   <[0-9]*>  high_water_mark  (in Gb)
   -t   <Path|SEP EasyArchive|SEP FDS DeDupStore|SEP i3 Store>  datastore type

Note that as of SEP sesam version 4.4.3, SEP EasyArchive data store and FDS deduplication store are no longer supported.

Drive parameter:
   -S   remote device server (client name, default: Sesam Server)
   -p   path (file system path where data will be stored)
   -n   SMS channels (default 5)
   -d   drive number
   -o   <'noconfig'> No execution of 'sm_config_drives' after drive creation
Remove options:
   -F   <YES> remove all objects belonging to client too, this action is critical and must be confirm with the argument "YES".
Drive group parameter:
   -G   drive group name (Default: datastore name)
Media pool parameter:
   -m   media pool name
   -e   eol

If '-p' parameter is set, the drive group and drive for this data store will be created automatically.

Examples:

  sm_cmd add datastore ds1 -i comment -c -10 -h -50 -l 0
  sm_cmd add datastore ds2 -c -10 -h -50 -l 0 -p E:\sesamdisk -G ds-group
  sm_cmd add datastore ds_local -c -1 -h -5 -p /sm_disk2 -G dg_ds_local -m Local_Disk -e 5
  sm_cmd modify datastore ds1 -i modified_comment -l -100
  sm_cmd remove datastore ds1

Tape library (loader)

This section explains how to configure your loader hardware.

Attention: Using loader slots

Export or mail slots cannot be used for backup. Media can be moved between them but backup jobs will only work with normal slots in the library.

Usage:

  sm_cmd <add|modify|remove> loader <loader number> [OPTIONS...]
  sm_cmd <load|unload|import|export> loader <loader number> [OPTIONS...]

Options (add|modify):

  -N   loader name
  -d   device *
  -S   remote device server  (reference clients>
  -t   type *
  -s   number of slots *
  -p   ports
  -b   barcode flag  <0|1> (default: 0)
  -a   autounload flag  <0|1> (default: 0)

Options (import|export):

  -p   port
  -s   slot or label

Options (load|unload):

  -d   drive number
  -s   slot

The loader can be created with given or automatically generated ID. The given loader ID must be unique.

  • Given ID: add loader 3 <params>
  • Auto ID: add loader auto <params>

Examples:

  sm_cmd add loader auto -d /dev/sg1 -t STK -s 254 -b y -a n
  sm_cmd load loader 1 -s 50 -d 1
  sm_cmd import loader 2 -p 2 -s 52

Loader device

Allows you to configure loader devices separately. This is useful when a station has several disks and each disk has its own device name.

Attention: Add loader device

The loader number of the loader device must exist in hw_loaders. (To get the information, use sm_cmd list loaders.)

Usage:

  sm_cmd <add|modify|remove> loaderdevice <loader_num> [OPTIONS...]

Options:

  -s   slot <[0-9]> *
  -d   device path *

A loader must exist before a loader device is created for it.

Example:

  sm_cmd add loaderdevice 2 -s 8 -d "/dev/sdx1"

Drive group

Each drive must be a member of a drive group. Drive groups must therefore be created before adding a drive.

Usage:

  sm_cmd <add|modify|remove> drivegroup <drivegroup name> [OPTIONS...]

Options:

  -i   comment

Examples:

  sm_cmd add drivegroup Tapedrives -i "LTO Drives"
  sm_cmd remove drivegroup diskdrives

Drive

After drive groups have been created, a drive can be added to the desired drive group. After adding or modifying a drive, SEP sesam immediately creates the internal drive structures. This will cause an interruption of all running backups. To avoid this, use the parameter -o noconfig. The drive configuration will only be written to the SEP sesam database. To use the drive for SEP sesam operations, you must first execute the sm_config_drives command manually.

Usage:

  sm_cmd <add|modify|remove|mount|dismount|unload> drive <drive number> [OPTIONS...]

Options:

  -l   loader number * (-L is set, reference hw_loaders)
  -L   loader drive * (-l is set)
  -t   type * (reference drive_types)
  -S   remote device server
  -G   drive group name * (-G or -g)
  -g   drive group id * (-G or -g)
  -d   device (* for data store)
  -N   drive name
  -n   SMS channels
  -o   'noconfig' do not call 'sm_config_drives'
  -D   data store
  -p   path

Options for action REMOVE: -o does not call shell command sm_config_drives and remove it only from db. Parameter must be set with argument noconfig.

Drives can be created with given or automatically generated IDs. The given drive ID must be unique.

  • Given ID: add drive 3 <params>
  • Auto ID: add drive auto <params>

Examples:

  sm_cmd add drive auto -t DLT -d /dev/nst0 -S beifus -G diskdrives -o noconfig
  sm_cmd add drive 4 -t HTX -d /dev/nst1 -S beifus -G diskdrives -o noconfig
  sm_cmd modify drive 3 -d Tape0
  sm_cmd mount drive 3
  sm_cmd remove drive 1

Media pool

The number of media pools required depends on the planned backup and media strategy. SEP sesam media pools are used for backup to tape and to disk.

Usage:

  sm_cmd <add|modify|remove> mediapool <mediapool name> [OPTIONS...]

Options:

  -G   drive group (* -G|-g))
  -g   drive group id (* -g|-G))
  -e   eol (*)
  -i   description
  -n   disk capacity in MB (only for DISK_HARD)
  -D   disk directory (only for DISK_HARD)

Examples:

  sm_cmd add mediapool LARGEDISK -G 1 -n 10000 -D /srv/SESAMPOOL/LARGE
  sm_cmd remove mediapool DISK

Media

A medium is part of a media pool.

Usage:

  sm_cmd <add|modifiy|remove> media <tape label> [OPTIONS...]

Options (add):

  -i   action <over|take> (default: take)
  -o   option <check|noncheck|recover> (default: check)
  -t   label
  -T   media type
  -b   barcode
  -c   format
  -d   drive number *
  -m   media pool *
  -L   media pool location
  -s   saveset

Options (modify):

  -e   eol
  -l   loader number
  -s   slot
  -i   comment
  -k   '+' to unlock, '-' to lock media

Examples:

  sm_cmd add media auto -d 1 -i check -m SINGLE -T THXKD
  sm_cmd modify media SINGLE00001 -k - -i "Important data"
  sm_cmd modify media DISK00006 -e 2009-08-19 09:00:00
  sm_cmd remove media DISK00006     (only possible, if drive/EOL is not active)

Inventory

The inventory function allows you to operate an archive adjustment and tape libraries with or without automatic media introduction.

Usage:

  sm_cmd <start> inventory <loader number> [OPTIONS...]

Options:

  -d   drive number  (* if -G or -d is set)
  -i   <action>  no|take|overwrite  do not introduce any media|take|overwrite
                                    SEP sesam media which are not in archive (default: no)
  -m   media pool  (* -i is set)
  -t   volume type  (* -i is set)
  -s   slot_area  <[0-9]{1,3}-[0-9]{1,3}>
                  Slot area, when not given all slots are handled.
                  The syntax for this parameter is n-m, e.g., 2-9.
                  First valid slot number is 0.
  -c   Check label flag, when set the label on tape is always checked,
       do not rely on the barcode information only.
  -f   Fast mode, when set label is read without retry in case of failure.
       Use this switch together with introduce switch only when you are
       sure that your call may introduce only new media.
  -L   Storage pool location for DISK_HARD media
  -G   drive group   (* if -G or -d is set)
  -n   <adjust with barcode>

Examples:

  • Without media introduction, only adjust the SEP sesam media information with the physical library.
  sm_cmd start inventory 2 -d 3 -m DAYPOOL -t LTO_Tape -s 2-7 -c
  • With media introduction, new media will be assigned to the media pool "DAYPOOL".
  sm_cmd start inventory 2 -d 3 -i take -m DAYPOOL -t LTO_Tape -s 2-7


Tasks

Task

Usage:

   sm_cmd <add|modify|remove> task <task name> [OPTIONS...]
   sm_cmd <start> task <task name> [OPTIONS...]

Options:

  -t   backup type (default: 'Path')
  -c   client name (* -c|-I)
  -I   client id   (* -c|-I)
  -s   source (*)
  -x   exclude
  -i   comment
  -o   backup options
  -r   restore options
  -P   prepost  <[yn]{4}>  ('yynn', 'ynyn', 'ynnn')
              (1. <y|n> activate pre interface
               2. <y|n> execute backup despite pre error
               3. <y|n> activate post interface
               4. <y|n> execute post despite backup error)
  -R   r_prepost  <[yn]{4}>  (see under prepost)
  -N   nfs_mount  <[yn]>
  -f   filesystem  <[yn]>
  -b   bsr_flag  <[01]>
  -C   compress_flag  <[01]>
  -E   crypt_flag  <[0ab]> ( * if -k is set )
              (1. [0] no crypt
               2. [a] AES256
               3. [b] blowfish64)
  -k   crypt_key ( * if -E is set )
  -F   <YES> remove task completely from all depending tables (pre-parameter)
  -V   vss=<0|1> disable/enable VSS, lvm=<0|1> disable/enable LVM
  -y   crypt savekey flag <[01]> (default is '1')
  -G   <taskgroup>   add task to taskgroup

Options (modify):

  -J   <new taskname>

Option for backup type vmware vsphere or ESX Server:

  -T   <main|config>   (main=backup vmdk with own saveset, config=backup vm config)

Options start:

  -m   media pool (*)
  -d   drive number
  -l   backup level  <[CFDI]>. Default: Copy
              C: Copy
              F: Full
              D: Diff
              I: Incr
  -a   hot/cold backup  <hot|cold>
  -S   backup interface  (reference interfaces)
  -T   start time   <YYYY-MM-DD hh:mm>

Parameter for cli auto

  -S   <client>/<backuptype/<source> generates a complete task with generated task name

Examples:

  sm_cmd add task minus_ini -c minus -s C:/programme/sepsesam/var/ini
  sm_cmd add task minus_secret -c minus -s C:/users -k mysecret -E a
  sm_cmd add task minus_secret -c beifus -s C:/tmp -G taskgroup01
  sm_cmd modify task minus_ini -x "C:/temp"
  sm_cmd remove task minus_ini
  sm_cmd remove -F YES task minus_ini
  sm_cmd start task minus_ini -m DISK -l D

Task group

Usage:

  sm_cmd <add|modify|remove> taskgroup <taskgroup name> [OPTIONS...]

Options:

  -i   comment
  -P   prepost

Example:

  sm_cmd add taskgroup all_systemstate -i "System state of all Windows hosts"

Task group relation

You can combine several tasks into task groups and determine their order of activation.

Usage:

  sm_cmd <add|modify|remove> taskgrouprelation <taskgroup name> [OPTIONS...]

Options (add):

  -j   task[,task1,task2...] (*)
  -n   start order  <[0-9]>

Options (modify):

  -j   task[,task1,task2...] (*)
  -n   start order  <[0-9]>

Options (delete):

  -j   task[,task1,task2...]task (*)
  -A   remove all tasks from task group (no argument is required)

Examples:

  sm_cmd add taskgrouprelation all_systemstate -j task1,task2 -n 1
  sm_cmd remove taskgrouprelation all_systemstate -j winfix_system

Migration task

Usage:

  sm_cmd <add|modify> migrationtask <migrationtask name> [OPTIONS...]

Options:

  -m   source pool (*)
  -M   target pool (*)
  -d   source drive (*)
  -D   target drive (*)
  -S   interface
  -n   saveset copy count (default:0 = unlimited)
  -L = <ref. media of sourcepool>  (starting on media)

Filter options:

  -l   backup levels <default:CFDI>
  -e   backup state  (0 = only successful
                      1 = successful or with warnings
                      3 = partially restorable)
  -B   date start    (absolute, i.e. "2009-08-14"
                      relative, i.e. "-3")
  -E   date end      (absolute, i.e. "2009-08-17"
                      relative, i.e. "0")
  -i   comment
Just one of the following 4 filter options can be set.
  -j   task  (reference tasks)
  -G   taskgroup  (reference taskgroups)
  -s   saveset
  -c   client (reference clients)

Example: Migrate backed up data from yesterday to today in media pool DISK to media pool TAPE.

  sm_cmd add migrationtask DISK2TAPE -m DISK -M TAPE -d 1 -D 2 -B "-1"

Restore task

Usage:

  sm_cmd <add|modifiy|remove> restoretask <restoretask name|auto> [OPTIONS...]

Options:

  -s   saveset (* reference DB:results.saveset)
  -l   restore type <full|selective> (default: 'f')
  -G   generation restore <0|1>
  -t   tree type <d|f>
       ( <d>    deep
         <f>    flat )
  -O   mode  <[nov]>
       ( <n>    non overwrite
         <o>    overwrite
         <v>    new version )
  -c   client  (reference clients)
  -R   target *
  -d   drive number *
  -S   interface
  -F   filter
  -P   prepost (nnnn)
  -o   options
  -i   comment
  -D   SEP sesam date <YYYY-MM-DD>
  -j   task
  -n   count
  -f   selection file

VMware vSphere options:

  -R   <datacenter>/<targetvm>
  -r   datastore
  -m   original flag <0|1>
  -E   esx server
  -a   options <rest|conf|vmdk|data|addvmdk>
  Parameters for option 'a':
    rest    restore VM config data only
    conf    create VM (vm ovf config file is required)
    vmdk    create empty virtual disks without  restoring data (vm conf config file is required)
    data    restore data of virtual disks
    addvmdk add further virtual disks to existing VM
  Options are separated by '.'
  Valid combinations of parameter 'a'
    rest                  Restore config
    rest.data             Restore config + restore VMDK data
    rest.conf             Restore config + create VM
    rest.conf.vmdk        Restore config + create VM + create VMDK
    rest.conf.vmdk.data   Restore config + create VM + create VMDK + restore VMDK data
    conf                  Create VM
    conf.vmdk             Create VM + create VMDK
    conf.vmdk.data        Create VM + create VMDK + restore VMDK data
    rest.vmdk             Restore config + create VMDK
    rest.vmdk.data        Restore config + create VMDK + restore VMDK data
    vmdk                  Create VMDK
    vmdk.data             Create VMDK + restore VMDK data
    rest.data.addvmdk     Restore config + create additional VMDK + restore VMDK data
    addvmdk.data          Create additional VMDK + restore VMDK data
    start                 Start VM after succussful restore"
Attention

All parameters of vSphere VMware options must be set to restore a virtual machine.

Mailbox restore: Restore for task types:

[SUSE_LINUX_OPENEXCHANGE_SERVER|OPEN_EXCHANGE_SERVER|CYRUS_IMAP|DOVECOT_IMAP|COURIER_IMAP]
  -a   <recover|norecover>

Restore tasks can be created with given or automatically generated names. The given restore task ID must be unique.

  • Given name: add restoretask 3 <params>
  • Auto name: add restoretask auto <params>

Examples:

sm_cmd add restoretask r_task01 -j SESAM_BACKUP -R \"c:\\tmp\" -f \"c:SaveTest\\seltest.sel\" -d 0
sm_cmd add restoretask r_task01 -s SF20090225121007 -R \"c:\\tmp\" -f \"c:SaveTest\\seltest.sel\" -d 1
sm_cmd modfiy restoretask r_task01 -i "comment for rTask"
sm_cmd remove restoretask r_task01

Examples for vSphere restore:

sm_cmd add restoretask r_task01 -R SEP-DC/clivm -r datastore1-esxix -E esxix.sep.de -j qsbox1_cloudcomputix_2_CGBlockTe -a online,recover -m 1
sm_cmd add restoretask rest01 -O over -R SEP-DC/CGTestVM -s SC20111207112045074@jClw-k-NaJW -r datastore2-esxix -E esxix.sep.de -a recover -m 0

Command task

Usage:

sm_cmd <add|modify|remove> command <command name> [OPTIONS...]
sm_cmd <start> <command name> [OPTIONS...]

Options:

  -c   client (* reference clients)
  -u   user name *
  -C   command *

Example:

sm_cmd add command unload_drive -c sesamx -u root -C /opt/sesam/bin/sesam/sm_loader unload

Restart task

A restart is the operation of a backup event that was executed with an error result. SEP sesam allows such broken events to be restarted in the same way as they were initially run.

Usage:

  sm_cmd restart [OPTIONS...]
  sm_cmd <list|help> restart

Options (restart):

  -D   sesam date <YYYY-MM-DD|today|yesterday> * (mandantory, if saveset not set)
                       <today>         restart all backups, that are failed today
                       <yesterday>     restart all backups, that are failed yesterday
  -s   saveset <saveset1,saveset2,...> * (mandantory, if SEP sesam date not set)
  -S   start time <YYYY-MM-DD hh:mm>
  -W   duration <[0-9*]>   max duration of schedule (default: 06:00)

Options (list):

  -D   <YYYY-MM-DD hh:mm:ss> (list restartable tasks by given day)

The parameter '-s' (saveset) can contain several savesets seperated by ','

Examples:

  sm_cmd restart -D 2010-09-03 -S "2010-07-09 15:04:16"
  sm_cmd restart -s SI20100901132603842
  sm_cmd restart -s SI20100901132603842,SI20100901132604050,SI20100902132605597
  sm_cmd list -d "|" -F named -C task restart -D "2012-03-06"
  sm_cmd list restart -D today


Schedules & Events

Schedule

If you want to execute backups to a specific timetable, tasks must be created first. A schedule must then be created and the task and schedule added to a backup event. Different event types can be connected to a schedule (see below). For reference, see the alternate GUI method of standard backup procedure . Usage:

  sm_cmd <add|modify|remove> schedule <schedule name> [OPTIONS...]

Options:

  -c   cycle flag  <0|1>  (default: 1 )
  -a   absolut flag  <0|1>
  -d   week days  <mo|tu|we|th|fr|sa|su>
  -T   cycle  <MIN|HOU|DAY|WEE|MON|YEA>
  -D   day of mth  <1-31>
  -M   mth of yea  <1-12>
  -W   wk of mth  <1-4>
  -O   day of wk  <day|weekday|weekendday|mo|tu|we|th|fr|sa|su>
  -S   startDate  <YYYY-MM-DD hh:mm>
  -E   endDate  <YYYY-MM-DD hh:mm>
  -x   exec  <[01]>
  -s   start time  <hh:mm>
  -w   duration  <hh:mm>
  -o   day offset  <0-99>
  -i   comment

Examples:

sm_cmd add schedule cli-test-daily -T DAY -s 12:20
sm_cmd add schedule cli-test-week -T WEE -s 12:20 -d sa,su
sm_cmd add schedule cli-test-month -T MON -s 12:20 -D 21
sm_cmd add schedule cli-test-year -T YEA -s 12:20 -D 2 -M 3 -w 2:00

The difference between a task and an event is as follows: a task is the actual job definition whereas the event determines how it is executed. In some cases, task properties can be overridden by the event.

Task event

Usage:

  sm_cmd <add|modify|remove> taskevent <ID|AUTO> [OPTIONS...]

Options (add|modify):

  -j   task (* -j|-G)
  -G   task group (*-G|-j)
  -l   backup type <[CFDI]> (default: 'C')
  -m   media pool (*)
  -d   drive number
  -S   interface name
  -p   priority <0-99>
  -@   command  (command, that will be executed after event is done)

Options (start)

  -x   schedule (reference schedules)
  -W   duration <[0-9*]>   max duration of schedule (default: 06:00)

Task events can be created with a given or automatically generated ID. The given task event ID must be unique.

  • Given ID: add taskevent 3 <params>
  • Auto ID: add taskevent auto <params>

Examples:

sm_cmd add taskevent auto -x cli_test_daily -j minus_ini -m DISK -l F
sm_cmd add taskevent 12 -x cli_test_daily -G all_systemstate -m TAPE -l C
sm_cmd modify taskevent 12 -p 2
sm_cmd remove taskevent 12

Migration event

Usage:

  sm_cmd <add|modify|remove> migrationevent <ID> [OPTIONS...]

Options:

  -x   schedule
  -s   saveset
  -G   saveset group
  -n   saveset count
  -D   target drive  (reference hw_drives)
  -M   target pool  (reference media_pools)
  -S   interface name
  -B   date start
  -E   date end
  -R   migration task (only available for 'MODIFY', reference DB:migration_tasks.name)
  -p   priority
  -K   blocking date
  -@   command  (command, that will be executed after event is done)

A migration event can be created with a given or automatically generated ID. The given migration event ID must be unique.

  • Given ID: add migrationevent 3 <params>
  • Auto ID: add migrationevent auto <params>

Examples:

sm_cmd add migrationevent auto -x schedule_daily -R migTask01
sm_cmd modify migrationevent 33 -p 2 -x schedule_daily
sm_cmd remove migrationevent 33
sm_cmd start migration D2L -j TEST_BACKUP -l FULL -m DISK -S sesamsrv -T \"2009-10-15 17:23:12\"

Restore event

Usage:

  sm_cmd <add|modify|remove|start> restoreevent <ID> [OPTIONS...]

Options:

  -x   schedule (* for ADD)
  -p   priority (default=1)
  -D   drive number
  -S   interface
  -T   start time  <YYYY-MM-DD hh:mm:ss>
  -R   restoretask  (*)
  -P   password
  -K   blocking date
  -@   command  (command, that will be executed after event is done)
  -s   use saveset

Restore events can be created with a given or automatically generated ID. The given restore event ID must be unique.

  • Given ID: add restoreevent 3 <options>
  • Auto ID: add restoreevent auto <options>

Examples:

sm_cmd  add restoreevent auto -R restoreTask01 -x daily_schedule
sm_cmd  add restoreevent 11 -R restoreTask02 -x daily_schedule
sm_cmd  modify restoreevent 11 -R dummy -x weekly_schedule
sm_cmd  remove restoreevent 11

Start a predefined restore task "Restart_Job1":

sm_cmd start restore Restart_Job1 -S sesamsrv

Command event

Usage:

  sm_cmd <add|modify> commandevent <ID|auto>> [OPTIONS...]
  sm_cmd <start> <command name> [OPTIONS...]

Options:

  -j   command  (* action add, reference commands)
  -x   schedule  (* action add)
  -p   priority  <0-99>
  -S   suppress
  -K   blocking date
  -@   command  (command be executed after event is done)

If the ID is set to 'auto', SEP sesam creates an unique ID. Command event can be created with a given or automatically generated ID. The given command event ID must be unique.

  • Given ID: add commandevent 3 <params>
  • Auto ID: add commandevent auto <params>

Examples:

sm_cmd add commandevent auto -j unload_drive -x UnloadDrive_Mo-Fr
sm_cmd start commandevent "test command"
sm_cmd remove commandevent 12

Media event

Usage:

  sm_cmd <add|modify> mediaevent <ID|auto>> [OPTIONS...]
  sm_cmd start mediaevent <mediapool name> [OPTIONS...]

Options:

  -x   schedule (* for ADD)
  -m   media pool  (*)
  -a   action  <init|readcheck|closetape>  *
         init:       initialise medium
         readcheck:  read medium
         closetape:  close medium for backups
  -d   driveNum <[0-9]*>
  -p   priority <[0-99]>
  -s   suppress
  -G   group flag  <0|1>
  -l   loader  <[0-9]*>
  -E   emergency
  -K   blocking date
  -@   command  (command that will be executed after event is done)

Media event can be created with a given ID or automatically generated ID. The given media event ID must be unique.

  • Given ID: add mediaevent 3 <params>
  • Auto ID: add mediaevent auto <params>


Examples:

       sm_cmd add mediaevent auto -m DISK -x media -a init
       sm_cmd modify mediaevent 31 -p 5 -x daily_schedule
       sm_cmd remove mediaevent 31


Shortcuts

Commonly used CLI commands can also be accessed through CLI shortcuts. Such CLI commands are shorter and the required parameter dependent on the shortcut type is set automatically.

Example shows the difference between default CLI usage and shortcut CLI usage. Default :

 >sm_cmd start mediapoolevent DISK -a init -d 2

Shortcut:

 >sm_cmd init -d 2 -m DISK

The following examples show all available shortcuts:

Init media pool:

 >sm_cmd init -d 2 -m DISK

Init media:

 >sm_cmd init -d 1 -t TAPE00002

Start backup

 >sm_cmd backup -j TEST_BACKUP -m DISK

Start backup group

 >sm_cmd backup -G SYSTEM -m Month -l diff

Start restore task

 >sm_cmd restore -s <ssid> -R /tmp

Start migration task

 >sm_cmd migrate -s <ssid> -D 1 -M DISK

Additional features

Email – Configuration and Send

Configure an account

Usage:

  sm_cmd <add|modify|remove> mailaccount <account name> [OPTIONS...]

Options:

  -C   customer
  -s   smtpEmailAddress *
  -h   smtpServer *
  -u   mailUser
  -p   mailPassword
  -t   mailTo
  -c   mailCC
  -b   mailBCC
  -S   ServiceLocation

Example:

  sm_cmd add account SEPsesam -h buildfix -s testmail@sep.de

Send an email

Usage:

  sm_cmd <send> mail <mailaccountname|NONE> [OPTIONS...]

Options:

  -t <recipient>            recipients (To:) (* account = NONE)
  -c <copy recipient>       set the (optional) mail address of the Cc (carbon copy) recipients
  -b <blind copy recipient> set the (optional) mail address of the Bcc (blind carbon copy) recipients
  -f <from>                 set the smtp email address of the sender  * (account = NONE)
  -h <host>                 SMTP server name
  -s <subject>              subject (*)
  -m <"message">            message text
  -M <"filename">           read message text from 'file'
  -a <attachment1>[,<attachment i>]
                             set the optional attached files of the mail
  -u <username>             SMTP account users name
  -p <password>             SMTP account password
  -v [0|1]                  log level

If the account name is 'NONE', the <-t, -f, -h> parameters are mandatory.

Examples:

  sm_cmd send mailer acc01 -s 'Sesam backup status' -m "testMessage"
  sm_cmd send mailer NONE -s 'Sesam backup status' -m "testMessage" -t cg@sep.de -f smptinfo@sep.de -h hotfix

Get SEP sesam information from database and logging

Display SEP sesam database content

The content of the SEP sesam database can be displayed by SEP sesam object (client, task, schedule etc.) using the list command. A special filter can be set to display options and configure the output.

Usage:

  sm_cmd list <cli-object> [OPTIONS...]

Options:

  -d   delimiter between columns (default:Tab, pre-parameter)
  -F   output format with argument <named|export|header|no_header> (pre-parameter)
    <named>    build pair of columnname and value for each column
         (id=0 name=LOCAL      parent=null     describe=null   contact=null    comment=null)
    <export>   convert output to "insert into" sql queries
      (INSERT INTO locations (id,name,parent,describe,contact,comment) VALUES ('8','t3','7','webtest','cg','tjo'))
    <header>   show column headers (set as default)
    <noheader> hide column headers
  -C   visible columns (pre-parameter)
  -s   sort order with argument (tablename:(a)scending, (d)escending) (pre-parameter)
  pre-parameter=parameter must be set before cli object type (sm_cmd <pre-parameter> clients <post-parameter>)

Table Media has special parameters ("list media")

  -D   list medias by given day
  -m   list media by media pool
  -l   list media by label

CLI action restart has special parameters ("list restart")

  -D   list restartable tasks by given day

Examples:

  sm_cmd list locations
  sm_cmd list -C "name,parent" locations
  sm_cmd list -s name:d,parent:a locations
  sm_cmd list -d "|" clients
  sm_cmd list -F named tasks
  sm_cmd list -d "|" -F noheader schedules

Display SEP sesam information and logs

Special SEP sesam information such as SEP sesam version, license and current drive status information can be displayed using the show command. In addition, SEP sesam log information can be displayed using show log.

Usage:

  sm_cmd show log <sesam|error|state|disaster|notify|alarm>
  sm_cmd show <license|calendar|version|current>

If no parameter is set, the current day will be used.

Options: Parameter for type 'sesam|error|state|disaster|notify|alarm|calendar'

   -B   <today|yesterday|YYYY-MM-DD>   start date (date argument of this parameter must be before -E end date, if only this parameter is set, all days between this and current date are show)
   -E   <today|yesterday|YYYY-MM-DD>   end date (show single day, if only this parameter is set)
   -D   <today|yesterday|YYYY-MM-DD>   single SEP sesam day

Parameter for type 'current'

   -d   <[0-9]>   show current messages depends on drive number (default show all drives)

Examples:

  sm_cmd show log sesam   (current day)
  sm_cmd show log error -B 2012-01-16 (all days between 2012-01-16 and today)
  sm_cmd show log state -B 2012-01-08 -E 2012-01-16
  sm_cmd show log notify -D yesterday
  sm_cmd show license
  sm_cmd show calendar  (Show activities of current date)
  sm_cmd show version   (Show version of SEP sesam components, similar to GUI About dialog)
  sm_cmd show current   (Show state of drives)

Control notification center

Send a notification to all GUI clients connected to the SEP sesam server.

Usage:

  sm_cmd <newday|ticker|popup|dialog|confirm|browse> [OPTIONS...]

Options:

  -m   message
  -o   object type
  -O   object
  -a   action
  -M   module

Options (list)

  -t   pending   list all notifications not already accepted

Examples:

  sm_cmd add notification popup -m "GUI update available"
  sm_cmd add notification dialog -m "SEP sesam license will expire on '04.06.2012'"
  sm_cmd add notification confirm -m "SEP sesam license is not valid"
  sm_cmd add notification confirm -o "license" -O "license 3463612" -a "open" -m "W125 License violation occurs"
  sm_cmd add notification confirm -o "license" -O "license 3463612" -a "close" -m "W125 License violation has been corrected"

Update GUI

Usage:

  sm_cmd <update> gui [OPTIONS...]

Options:

  -a   alternative path for SEP sesam 'jar' file

Direct access to the SEP sesam database

Attention: DB Direct Access

When executing a direct SQL command, there is no validation check of the command. Incorrect use (update or delete) can therefore destroy the SEP sesam database! Be EXTREMELY careful when using a SQL command directly.


Usage:

  sm_cmd sql <sqlquery> [OPTIONS...]

Options:

  -d   column delimiter (default:Tab)
  -F   output format <named|export|header|no_header>)
    <named>    build pair of columnname and value for each column
         (id=0 name=LOCAL      parent=null     describe=null   contact=null    comment=null)
    <export>   convert output to "insert into" sql queries
      (INSERT INTO locations (id,name,parent,describe,contact,comment) VALUES ('8','t3','7','webtest','cg','tjo'))
    <header>   show column headers (set as default)
    <noheader> hide column headers

Examples:

  sm_cmd sql "select * from locations"
  sm_cmd sql "select * from clients" -d |"
  sm_cmd sql "select * from tasks" -F named"
  sm_cmd sql "select * from schedules" -d | -F noheader"




Error codes

In the event of an error, the CLI returns a specific error code which describes the error type.

Error Code Error Type
2 CLIException
3 SQLException
4 NumberFormatException
5 RemoteException
6 FileNotFoundException
7 IOException
8 InvocationTargetException
9 unknown Exception




Syntax examples

Construct a backup event

Location
Create a new location SEP-MUNICH where the location ID = 33.

sm_cmd add location 33 -L SEP-MUNICH

Backup client
In the next step, a new Linux backup client with the hostname lx01 will be registered and assigned to the location SEP-MUNICH.

sm_cmd add client lx01 -o LINUX -a CTRL -L 33

Backup task
Create two backup tasks for client lx01 with the backup source /etc and a complete backup of the local machine without the directory /tmp.

sm_cmd add task lx01_etc -c lx01 -s /etc
sm_cmd add task lx01_all -c lx01 -x '\./tmp$' -s All

Schedule
Create two new schedules. One for a daily backup at 10 p.m. and the second for a backup every Sunday at 9 p.m.

sm_cmd add schedule daily-backup -T DAY -s 22:00
sm_cmd add schedule sunday-backup -T WEE -s 21:00 -d su

Events for the schedules
After the creation of the schedules, the backup event will link the backup tasks to the schedules.

  • Every Sunday, a full backup of the backup task lx01_etc to the media pool WEEK will be executed with priority 2.
sm_cmd add taskevent auto -j lx01_etc -s sunday-backup -m WEEK -l FULL -p 2
  • On other days, the backup task lx01_etc will be executed as a differential backup to the media pool DAY. Every Sunday, the priority 2 backup of the schedule sunday-backup overrides the daily-backup schedule with prio 1. The prio 1 backup is then suppressed. For details on how SEP sesam handles event priorities, see SEPuler: Event Priority.
sm_cmd add taskevent auto -j ly01_etc -s daily-backup -m DAY -l DIFF -p 1
  • On Sundays, a full backup of the task lx01_all will be executed as a copy backup to the media pool WEEK.
sm_cmd add taskevent auto -j lx01_all -s sunday-backup -m WEEK -l COPY

See also

CLI ShowcaseSBC CLISEP sesam GUI