#!/bin/sh
#  File: sbc_pre_event_group
#
#
# Sesam PRE event procedure for Linux servers
#
# Description: 
#    This script is called from SEP sesam kernel, before 
#    tasks belonging to a task group are read from Sesam database.
#    It gives the user a possibility to add/delete/modify tasks
#    belonging to a task group.
#
# Parameters:
#    $1 = task group name
#
# Help:
#    See https://wiki.sepsoftware.com/wiki/index.php/Automating_Backup_of_Virtual_Machines
#    or check help options of SEP sesam command line interface (CLI): 'sm_cmd help dir client' or 'sm_cmd help taskgen'
#
# Examples:
#             
#    Create vSphere backup tasks: 
#       sm_cmd "dir" -F JSON "vsphere" -k 'Backup required=yes' /vcenter-srv| sm_cmd add taskgen "vsphere_{{client}}_{{source}}_{{count}}"  -t "VMware vSphere" -O "source_not_found,remove_non_existing" -G $1 -a refresh=true -T _CBT -f - 
#
#    Create Hyper-V backup tasks:
#       sm_cmd dir -F JSON client -l 1 "hyperv-srv" "-i" "StartingWith.*" | sm_cmd add taskgen "hyperv_gen_{{client}}_{{source}}_{{count}}" -O "source_not_found,remove_non_existing" -t "Hyper-V" -G $1 -f -
#
#    Create Citrix XenServer backup tasks:
#       sm_cmd dir -F JSON client -l 1 "xenserver.sep.de" -k "powerState=Running" | sm_cmd add taskgen "citrix_gen_{{client}}_{{source}}_{{count}}" -O "source_not_found" -t "Citrix XenServer" -G $1 -f -
#
#    Create RHV backup tasks:
#       sm_cmd dir -F JSON client -l 1 "rhv.srv.sep.de" | sm_cmd add taskgen "rhv_gen_{{client}}_{{source}}_{{count}}" -O "source_not_found" -t "RHEV" -G $1 -f -
#
#    Create MS SQL Server backup tasks:
#       sm_cmd dir -F json client -o recursive "/mssql-srv/MS SQL Server:" | sm_cmd add taskgen "mssql_gen_{{client}}_{{source_last_item}}{{underPrefix count_optional}}" -t "MS SQL Server" -G $1 -f -
