# {{{ Header ===================================================================
#
#          FILE: /hana/scripts/backup.conf
# 
#         USAGE: source /hana/scripts/backup.conf in backup.sh
# 
#   DESCRIPTION: Configuration file for backup of Hana databases with backup.sh:
# 
#       OPTIONS: ---
#
#  REQUIREMENTS: Script backup.sh
#
#         NOTES: ---
#        AUTHOR: Klaus Joerissen (KJ)
#                Steffen Kamphoff (SK)
#  ORGANIZATION: iSystems Consulting e.K.
#       CREATED: 02.08.2016 23:39
#      REVISION: 2.11 21.12.17 23:19
#
# {{{   CHANGES: see backup.sh
#
#	  TODOS: -
#
#  ADDITIONAL INFORMATION  -  IMPORTANT  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#
#      Es werden 2 verschiedene Backups durchgef�hrt:
#      1. Backup des kompletten HANA-Systems mit allen Datenbanken, so wie es 
#         auch aus dem HANA-Studio heraus erfolgt.
#      2. Backup der einzelnen Datenbanken, so wie hier in den Einstellungen
#         weiter unten ausgew�hlt.
#      3. Optional k�nnen die Backups in die iSystems Cloud kopiert werden
#
#      Die Pfade f�r die Sicherungen und die Aufbewahrungszeiten k�nnen separat
#      festgelegt werden.
#
#
#
#
#
#
#
# }}}
# }}} ==========================================================================

# {{{ Settings logging and environment =========================================
#
set -o nounset  			  # Treat unset variables as an error
mkdir -p /var/log/SAP >/dev/NUL
jobcontrol="/var/log/SAP/backupcontrol.log"

# exec 3>&1 4>&2
# trap 'exec 2>&4 1>&3' 0 1 2 3 RETURN
exec 1>>$jobcontrol 
exec 2>>$jobcontrol
# }}}

# {{{ Settings for backup, hana access, etc. ===================================
#
# Backup destination directories
HANA_backup_dir="/backup"                 # Hana Backup directory
                                          # determined in Hana Studio 
DEST_fbck="/hana/bck_volume/backups_full" # Destination path for full backups of 
                                          # the HANA System (like via HANA Studio)
DEST_partdb="/hana/bck_volume/backups_db" # Destination path for backup of the 
                                          # particular databases
MyWorkDir="/hana/scripts"		  # Work directory for script execution
MyTempDir="/hana/temp"                    # Temporary directory used to put 
                                          # backup files during script execution
                                          # Should not be a mounted volume from
                                          # another server or a share!!!


# Hana database access variables
MyUSER="SYSTEM"
MyPASS="RNgpB9Kr"
MyHOST="10.2.25.2"
systemid="NDB"
instance=00
DELETE_OLD_BACKUPS=1
maxAGE_fbck="1"                           # ATTENTION: this only deletes the 
                                          # backups in SAP Hana, NOT the backups
                                          # on the backup volume!
maxAGE_partdb="1"                         # If you are short of space on your volume
                                          # and you upload your backup files to the
                                          # iSystems cloud, you should set both maxAGE
                                          # parameters to 1
MyCLUSTER="0"                  # 0=no, 1=yes

# Which databases to backup
# noch separates Prefix einbauen, wenn nicht "SBO" verwendet wird !!!!!!!!!!!!!!
# DBS="example1 example2 example3"
# Or uncomment next line to get all databases:
DBS="$(/usr/sap/NDB/HDB00/exe/hdbsql -i $instance -n $MyHOST -u $MyUSER -p $MyPASS -x -a -j 'select "SCHEMA_NAME" from "SYS"."SCHEMAS" WHERE "SCHEMA_NAME" LIKE '\''%%SBO%'\'' and "SCHEMA_NAME" <> '\''SBOCOMMON'\'' ')"

# DO NOT BACKUP these databases
IGGY="SBOCOMMON"

# Access to backup destination share
# if the backup destination is in the local filesystem of the server, just give
# the smbMOUNTPOINT as destination path for the backup
smbBACKUP="0"                          # copy backup to destination smb share (0=no, 1=yes)
smbUSER="hana"
smbPASS="password"
smbDOMAIN=""
smbIP="192.168.191.23"
smbDIR=""
smbMOUNTPOINT="/hana/bck_volume"

# Access to iSystems Cloud
isysCLOUD="0"                        # use iSystems Cloud (0=no, 1=yes)
isysLOCATION="usbck.privatcloud.biz"
isysUSER="condemo456871"
isysmaxAGE=9
# }}}

# {{{ Settings for email notification ==========================================
#
SEND_EMAIL="0"                       # 1=yes, 0=no
NOTIFY_RECEIVER="backups@isystems-integration.com"                    # receiver email address
NOTIFY_MAILSERVER="192.168.101.6"                    # smtp mailserver
NOTIFY_PORT="25"                     # std: 25, TLS: 587, SSL: 465
NOTIFY_FROM="eu@isystems-mailing.de"                            # sender address
NOTIFY_SENDER="eu@isystems-mailing.de"                        # username authentification
NOTIFY_PWD="eEu^6k95"                  # password authentification
NOTIFY_SUBJECT="SAP HANA Backup Message"                      # subject of message
NOTIFY_CUSTOMER="Conplus"                    # additional customer name
NOTIFY_AUTHGERAFFEL=""            # DO NOT change this!
# }}}
