SEP Sesam CLI
Copyright © SEP AG 1999-2013. 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.
Introduction
The SEP Sesam command line interface (SEP Sesam CLI) is used to install and configure a SEP Sesam environment automatically without any GUI. This CLI is integrated in the SEP Sesam server from version 3.6 and higher. 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 Sesam status, log and version information
- Determining Sesam object information for further use in other programs
| Attention: Recommendations for using the SEP Sesam Command Line Interface (CLI) |
|
When using the optional command line features of SEP Sesam commands are written directly to the SEP Sesam database. The commands are immediately acted upon by SEP Sesam once the <Enter> key is pressed. Therefore, there is no chance to correct or change an entry, which is possible when using the SEP Sesam GUI. For this reason it is extremely important to follow a specific and defined plan when using the command line to prevent a user caused system failure in the backup environment. Such a mistake is not to be underestimated – a wrong or mistaken entry can lead to complete data loss or other damage to the database. Unchecked or unverified command line entries should be avoided! Such mistakes can void the warranty offered by your SEP Sesam licensing agreement. Before you start with scripting with the SEP Sesam CLI you should acquire basic knowledge about the SEP Sesam environment. First study the Sesam user manual and the Sesam administration manual and work with a SEP Sesam installation to get experience how the SEP Sesam objects work together. Alternatively, use the seminar offers from SEP AG to learn the main structure of the functions and configuration of the SEP Sesam. After that you're ready to start working with the SEP Sesam CLI and write your first scripts. |
CLI example
| CLI example |
|
Before you start reading the syntax description it could be helpful to have a look at a small SEP Sesam CLI example for creation of a new SEP Sesam environment by SEP Sesam CLI. |
Using the SEP Sesam Command Line Interface (CLI)
The following chapter describes the use of the object items of the SEP Sesam CLI. There are mandatory and optional options. Mandatory options are designated by an asterisk (*). At the end of each object section there are one or more examples on how to use the command.
When building a new SEP Sesam environment using the CLI, work in the same order as you would when using the SEP Sesam GUI. Start with the Topology objects, then create tasks, schedules and finally connect the according events (e.g. backup, migration or command) to the schedules.
| Attention: Global Deletion |
|
With "Global Deletion" it's possible to delete a client or task with all dependent or related objects. That means if you want to delete a client you can delete all of its appropriate tasks at the same time. For example, if you delete a task during this process it will be removed from its task groups and task events. "Global Deletion" is available for client and task. You can enforce that 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 the parameter Force. First remove the loader or drive and then re-start the client/task deletion. |
| Syntaxes | ||||||||||||||||||||||||||
CLI main callUsage: sm_cmd <server-options> <command> <object> <options> Server-options: -S <server> 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
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 suppressed by redirecting stderr to /dev/null.
Displaying SEP Sesam DB dataThe content of the SEP Sesam DB concerning several actions can be displayed with the parameter list or sql. Options:
Examples: The delimiter parameter is only valid with specific formats. Some usage examples follow:
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:
Command: sm_cmd list locations sm_cmd sql "select * from locations" Output: id name parent describe contact comment 0 LOCAL NULL NULL NULL NULL
Command: sm_cmd list locations -F noheader sm_cmd sql "select * from locations" -F noheader Output: 0 LOCAL NULL NULL NULL NULL
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
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)" TopologyLocationAfter the installation of a new SEP sesam server a standard location - named Local - is created. You can use this default location to add your clients or create your own locations as desired. Usage: sm_cmd <add|modify|remove> location ID [OPTIONS...]
If 'ID' is set to 'auto' 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. Given location ID must be unique. Given ID: add location 3 <options...> Auto ID: add location auto <options...> Example: 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 ClientRight after the installation of a new SEP sesam Server the SEP sesam server client object already exists. You have to register your backup clients in the SEP sesam environment before you can use them. If you add clients with the SEP sesam GUI during the registration process the SEP sesam Server checks if the client is visible/reachable to him. This is different with the SEP sesam CLI and therefore it's recommended to check the client availability by starting a small backup task after adding it (client). 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 Example: 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 InterfaceThe configuration of the interface is only necessary if you want to use LAN-free backup or a SAN environment. Your backup server has to have at least two network interface modules. They have to be configured with different IP addresses and DNS names. You can then create an interface for every network interface you'd like to use. For more information see the SEP sesam Admin Guide. Usage: sm_cmd <add|remove> interface <interface name> [OPTIONS...] Options: -c clientname (*) Example: sm_cmd add interface buildfix.sep.de -c buildfix sm_cmd remove interface buildfix DataStoreSesam DatStore is the object for backup to disk. Similar to the DataStore preparation in the Sesam GUI, it's possible to create all depending Sesam objects, like drive group, drive and mediapool, in one step. For detailed information about the functionality read the Sesam user guide first. 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 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, drive group and drive for this datastore will be created automatically Example: 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 will instruct you on how to configure your loader hardware.
sm_cmd <add|modify|remove> loader <loader number> [OPTIONS...] sm_cmd <load|unload|import|export> loader <loader number> [OPTIONS...] Options (add|modify):<b> -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) <b>Options (import|export): -p port -s slot or label Options (load|unload): -d drive number -s slot Loader can be created with given ID or automatic generated ID. Given Loader ID's must be unique Given ID: add loader 3 <params> Auto ID: add loader auto <params> Example: 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 DeviceHere you configure your loader devices seperately. That makes sense if you are running a "bunch of disk" station where every disk has its own device name.
Usage: sm_cmd <add|modify|remove> loaderdevice <loader_num> [OPTIONS...] Options: -s slot <[0-9]> * -d device path * Loader must exists before creating a loader device for it Example: sm_cmd add loaderdevice 2 -s 8 -d "/dev/sdx1" Drive groupEvery drive must be a member of a drive group. Therefore, drive group has to be created before adding a drive. Usage: sm_cmd <add|modify|remove> drivegroup <drivegroup name> [OPTIONS...] Options: -i comment Example: sm_cmd add drivegroup Tapedrives -i "LTO Drives" sm_cmd remove drivegroup diskdrives DriveAfter creating drive groups you can add your drive 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, you can use the parameter -o noconfig. The drive configuration will only be written into the SEP sesam database. To use the drive for SEP sesam operation 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 doesn´t 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 ID or automatic generated ID. Given Drive ID's must be unique Given ID: add drive 3 <params> Auto ID: add drive auto <params> Example: 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 MediapoolThe number of necessary mediapools depends on your planned backup and media strategy. Sesam mediapools will be 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) Example: sm_cmd add mediapool LARGEDISK -G 1 -n 10000 -D /srv/SESAMPOOL/LARGE sm_cmd remove mediapool DISK MediaA medium is a part of a mediapool. 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 mediapool location -s saveset Options (modify): -e eol -l loader number -s slot -i comment -k '+' to unlock, '-' to lock media Example: 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) InventoryWith the inventory function you can operate a archive adjustment an 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
SEPsesam media which are not in archive (default: no)
-m mediapool (* -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,
don't 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 really new media.
-L Storage pool location for DISK_HARD media
-G drive group (* if -G or -d is set)
-n <adjust with barcode>
Example: comment: without media introduction, only adjust the Sesam media information with the physical library sm_cmd start inventory 2 -d 3 -m DAYPOOL -t LTO_Tape -s 2-7 -c comment: with media introduction, new media will be assigned to the mediapool "DAYPOOL" sm_cmd start inventory 2 -d 3 -i take -m DAYPOOL -t LTO_Tape -s 2-7 TasksTaskUsage: 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<b> for cli 'auto' -S <client>/<backuptype/<source> generates a complete task with generated taskname <b>Example: 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 TaskgroupUsage: 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" Taskgroup relationYou can combine several tasks to task groups and arrange the 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) Example: sm_cmd add taskgrouprelation all_systemstate -j task1,task2 -n 1 sm_cmd remove taskgrouprelation all_systemstate -j winfix_system Migration taskUsage: 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: comment: migrate backed up data from yesterday to today
in mediapool DISK to mediapool TAPE
sm_cmd add migrationtask DISK2TAPE -m DISK -M TAPE -d 1 -D 2 -B "-1"
Restore taskUsage: 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 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 seperated 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 task can be created with given or automatic generated name. Given restore task ID must be unique Given name: add restoretask 3 <params> Auto name: add restoretask auto <params> Example: 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 Example 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 taskUsage: 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 TaskA restart is a operation of a already executed backup event with an error result. SEP sesam allows to restart such broken events on the same way as they were run at the first time. 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 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) Parameter '-s' (saveset) can contain several savesets seperated by ',' Example: 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 & EventsScheduleIf you want to execute your backups on a specific time table you have to create tasks first. Then you must create a schedule and add the task and the schedule to a backup event. There are different event types to connect to a schedule (see below). 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 Example: 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 What is the difference between task and event? The Task is the actual job definition, but the event determines the behavior of the execution. In some cases, task properties can be overdriven by the event. Task eventUsage: sm_cmd <add|modify|remove|start> 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) Taskevents can be created with a given or automatic generated ID. Given Taskevent ID must be unique Given ID: add taskevent 3 <params> Auto ID: add taskevent auto <params> Example: 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 eventUsage: 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) Migration event can be created with given a given or automatic generated ID. Given migration event ID must be unique Given ID: add migrationevent 3 <params> Auto ID: add migrationevent auto <params> Example: 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 eventUsage: 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 given or automatic generated ID. 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 comment: start a predefined restore tast "Restart_Job1" sm_cmd start restore Restart_Job1 -S sesamsrv Command eventUsage: 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 ID is set to 'auto' Sesam creates an unique ID. Commandevent can be created with given ID or automatic generated ID. Given commandevent ID must be unique Given Name: add commandevent 3 <params> Auto Name: add commandevent auto <params> Example: sm_cmd add commandevent auto -j unload_drive -x UnloadDrive_Mo-Fr sm_cmd start commandevent "test command" sm_cmd remove commandevent 12 Media eventUsage: sm_cmd <add|modify> mediaevent <ID|auto>> [OPTIONS...] sm_cmd start mediaevent <mediapool name> [OPTIONS...] Options: -x schedule (* for ADD)
-m MediaPool (*)
-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 given ID or automatic generated ID. Given MediaEvent ID's 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
ShortcutsCLI commands often used are also accessible through CLI shortcuts. The advantage is that the CLI command is shorter and the required parameter dependent on shortcut type will be set automatically. Example to show the difference between default cli usage and cli with shortcut usage: default : >sm_cmd start mediapoolevent DISK -a init -d 2 shortcut: >sm_cmd init -d 2 -m DISK
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 featuresEmail - Configuration and SendConfigure an accountUsage: 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 emailUsage: 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 account name 'NONE' parameters <-t, -f, -h> are mandatory Example: 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 Sesam information from database and loggingDisplay Sesam database contentWith the list command you can display the content of the Sesam database by Sesam object (client, task, schedule etc.). You can set special filter and display options to 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 mediapool -l list media by label CLI action restart has special parameters ("list restart") -D list restartable tasks by given day Example: 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 Sesam information and logsWith the "show" command, it's possible to display special SEsam information like Sesam version, license and current drive status information. In addition, with "show log" you can display Sesam log information. 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 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 Sesam components, like GUI about dialog) sm_cmd show current (Show state of drives) Control Notification CenterSend a notification to all GUI clients connected to 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 Example: 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 GUIUsage: sm_cmd <update> gui [OPTIONS...] Options: -a alternative path for Sesam 'jar' file Direct access to the SEP sesam database
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
Example: 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"
ErrorcodesIn case of an error the CLI returns a specific error code which describes the error type. See the following list of error codes:
Syntax examples
|