From SEPsesam
Jump to: navigation, search

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


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.


  • 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.


CLI main call


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:

     help                     list the options for a specific command
     show <license|version|calendar|current>
     show log <sesam|error|state|disaster|notify|alarm>

Commands for drive only:


Commands for loader only:





sm_cmd -v 2 add task barometrix_etc -c -s /etc


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')'

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.


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


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

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


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




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




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



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

  • Standard display without format parameter


sm_cmd list locations
sm_cmd sql "select * from locations"


id	name	parent	describe	contact	comment
  • Hide the column header


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


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


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


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)


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


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)"



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.


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


  -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...>


  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


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.


  sm_cmd <add|modify|remove> client <hostname> [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


  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


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.


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


  -c   clientname (*)


  sm_cmd add interface -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.


   sm_cmd <add|modify|remove> datastore <datastore name> [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.


  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.


  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>


  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.)


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


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

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


  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.


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


  -i   comment


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


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.


  sm_cmd <add|modify|remove|mount|dismount|unload> drive <drive number> [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>


  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.


  sm_cmd <add|modify|remove> mediapool <mediapool name> [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)


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


A medium is part of a media pool.


  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


  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)


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


  sm_cmd <start> inventory <loader number> [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>


  • 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




   sm_cmd <add|modify|remove> task <task name> [OPTIONS...]
   sm_cmd <start> task <task name> [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


  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


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


  -i   comment
  -P   prepost


  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.


  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)


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

Migration task


  sm_cmd <add|modify> migrationtask <migrationtask name> [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


  sm_cmd <add|modifiy|remove> restoretask <restoretask name|auto> [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             Restore config + restore VMDK data
    rest.conf             Restore config + create VM
    rest.conf.vmdk        Restore config + create VM + create VMDK   Restore config + create VM + create VMDK + restore VMDK data
    conf                  Create VM
    conf.vmdk             Create VM + create VMDK        Create VM + create VMDK + restore VMDK data
    rest.vmdk             Restore config + create VMDK        Restore config + create VMDK + restore VMDK data
    vmdk                  Create VMDK             Create VMDK + restore VMDK data     Restore config + create additional VMDK + restore VMDK data          Create additional VMDK + restore VMDK data
    start                 Start VM after succussful restore"

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

Mailbox restore: Restore for task types:

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


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 -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 -a recover -m 0

Command task


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


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


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.


  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 ','


  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


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...]


  -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


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


  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
  -K   supress [0|1]
  -p   priority <0-99>
  -s   source side deduplication [0|1]
  -@   follow up 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>


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


  sm_cmd <add|modify|remove> migrationevent <ID> [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
  -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>


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


  sm_cmd <add|modify|remove|start> restoreevent <ID> [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>


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


  sm_cmd <add|modify> commandevent <ID|auto>> [OPTIONS...]
  sm_cmd <start> <command name> [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>


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


  sm_cmd <add|modify> mediaevent <ID|auto>> [OPTIONS...]
  sm_cmd start mediaevent <mediapool name> [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>


       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


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


 >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


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


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


  sm_cmd add account SEPsesam -h buildfix -s

Send an email


  sm_cmd <send> mail <mailaccountname|NONE> [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.


  sm_cmd send mailer acc01 -s 'Sesam backup status' -m "testMessage"
  sm_cmd send mailer NONE -s 'Sesam backup status' -m "testMessage" -t -f -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.


  sm_cmd list <cli-object> [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


  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.


  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)


  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.


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


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

Options (list)

  -t   pending   list all notifications not already accepted


  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


  sm_cmd <update> gui [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.


  sm_cmd sql <sqlquery> [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


  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

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

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