SQWareProduction:cassandra:bin:sqwcas Backup.ksh

From Wiki_dbSQWare
Jump to: navigation, search

Presentation

Script $gvsqw_CasBin/sqwcas_Backup.ksh :


Run a backup on all nodes

  • Scope of execution (by default: Local)


** Local => seulement le node local
** LocalNode => seulement le node local
** Node_$NodeName => seulement sur le node '$NodeName'
** LocalDC => tous les nodes sur local datacenter
** DC_$DCName => tous les nodes sur datacenter '$DCName'
** All => tous les nodes sur cluster(tous les datacenters)
** AllNodes => tous les nodes sur cluster(tous les datacenters)
** AllDC => tous les nodes sur cluster(tous les datacenters)



Online help

The online help is available for most scripts with the -h option.
Ex: $gvsqw_CasBin/sqwcas_Backup.ksh -h
Content of this assistance :

Sourcing sqwcas_Global.lib v2024.02 SQWareProduction for Cassandra (dbSQWare) ... 

Usage: sqwcas_Backup.ksh [-h] -I <CAS_SID> -Type <backup type> [+ options]

DESCRIPTION
   sqwcas_Backup.ksh Run backup on all nodes
SUPPORT
   Cassandra supported versions: 2.0 <= v <= 4.0

PARAMETERS
     -I  instance       : Target instance.
     -Type type         : Type of backup full (snapshot) or inc (backup).
OPTIONS
     -h                 : Display the full usage.
     -s                 : Display samples of usage.
     -S    scope        : Scope of the execution (by default: All).
                             Local           => only on the local node.
                             LocalNode       => only on the local node.
                             Node_$NodeName => only on the node '$NodeName'.
                             LocalDC         => all nodes on the local datacenter.
                             DC_$DCName     => all nodes on the datacenter '$DCName'.
                             All             => all nodes on the cluster(all datacenters).
                             AllNodes        => all nodes on the cluster(all datacenters).
                             AllDC           => all nodes on the cluster(all datacenters).
     -P   Nb threads    : Number of threads in parallel (by default 3).
     -HI Nb             : Nb of generations to keep (by default 2).
     -AGR Nb_sec        : Nb of seconds between two runs (by default 0s).
     -AGE Nb_sec        : Nb of seconds between two checks of end (by default 5s).
     -FRT       code    : Force return code value on error.
     -AddMail   email   : Email address to add at 'pmexpdba@gmail.com'.
     -Timeout Nb_sec    : Timeout kill of ssh session.
     -SendReport        : Send execution log report.
     -NoMail            : Deactivate sendmail on error pmexpdba@gmail.com (by default, send on error).
     -Locale    locale  : Force Locale for help display (fr,en).
     -NoDelete          : Keep history.
     -Exec              : Execute commands (by default, display generated commands).

Nuvola apps information.png
Note:
To be sure the aid is accurate, refer directly to the online help script -h option.


Error management

Errors passing arguments

This type of message is generated:

Lack 'CAS_SID' parameter, Usage: sqwcas_Backup.ksh [-h] -I <CAS_SID> -Type <backup type> [+ options]
For full help : sqwcas_Backup.ksh -h

If you are connecting through a terminal, no mail will be sent and you will have more this kind of message:

Not sending mail because you are in connected mode !!!
Lack 'CAS_SID' parameter

If you are not connected to a terminal, the error message appears and is sent by mail to the address contained in the variable $gvsqw_GlobalMail (See help customize this variable). The subject line will always start by "$gvsqw_MailMsg_cassandra : " (See help customize this variable).

Nuvola apps information.png
Note:
Sending mail can be disabled by the option -NoMail for one execution.


Execution errors

Whether you are or not connected to a terminal, the error message appears and an email containing a summary of treatment errors is sent to the address contained in the variable $gvsqw_Mail_cassandra (See help customize this variable). The subject line will always start by "$gvsqw_MailMsg_cassandra : " (See help customize this variable).

Nuvola apps information.png
Note:
Sending mail can be disabled by the option -NoMail for one execution.


Usage examples

Sourcing sqwcas_Global.lib v2024.02 SQWareProduction for Cassandra (dbSQWare) ... 

#Standard help for script sqwcas_Backup.ksh:

$gvsqw_CasBin/sqwcas_Backup.ksh -h
#Display online help for this script

$gvsqw_CasBin/sqwcas_Backup.ksh -Locale en -h
#Display online help for this script with forcing of the 'en' locale (by default locale managed by $gvsqw_Locale)

$gvsqw_CasBin/sqwcas_Backup.ksh -s
#Display usage examples for this script

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType>
#Display generated commands without execute them !

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType> -HI 4 -Exec
#Execute backup with the selected type of backup : 'full' (snapshot) or 'inc' (backup), and keep 4 historical backup

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType> -S <Scope> -HI <NumberOfGenerations> -Exec
#Changes the scope <Scope> of execution (local by default) and the number of backup generations <NumberOfGenerations> to keep (by default 2), manage by $gvsqw_backupNbGeneration)

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType> -NoDelete -Exec
#Retains backup history (by default 2, managed by $gvsqw_backupNbGeneration)

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType> -AGR 20 -Exec
#Set the waiting time in seconds between two command run, 20s here (by default is 0 manage by $lvsqw_AggressivenessRun)

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType> -AGE 40 -Exec
#Set the waiting time in seconds between two end checks, 40s here (by default is 5 manage by $lvsqw_AggressivenessCheckEnd)

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType> -P <NumericValue> -Exec
#Run sqwcas_Backup.ksh script with a parallel degree of '<NumericValue>'
#Use by default the variable gvsqw_NbThreadXXX in $gvsqw_<gvsqw_RdbmsTrigram>/../etc/sqw<gvsqw_RdbmsTrigram>_GlobalVar.cfg
#You can change this default on all your environnement if you set this variable
#in configuration file $gvsqw_<gvsqw_RdbmsTrigram>/../etc_cust/sqw<gvsqw_RdbmsTrigram>_GlobalVar.cfg

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType> -AddMail 'mymail1@mydomaine.com,mymail2@mydomaine.com' -Exec
#Add the mail list to the default address managed by $gvsqw_GlobalMail (only this time), if needed separate by commas

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType> -SendReport -Exec
#Send the log by email at the end of the treatment even if there is no error (by default, send on error)

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType> -NoMail -Exec
#Disables sending an email on error to $gvsqw_GlobalMail (by default, send on error)

$gvsqw_CasBin/sqwcas_Backup.ksh -I $CAS_SID -Type <BackupType> -FRT <NumericValue> -Exec
#Force return code to '<NumericValue>' on error (if no error, "exit 0!")
#You can also force return code of this script on all your
#environnement if you set the variable: $gvsqw_ForcedReturnCodeScript_sqwcas_Backup=<NumericValue>
#in configuration file $gvsqw_CasBin/../etc_cust/sqwcas_GlobalVar.cfg
Nuvola apps information.png
Note:
To be sure the examples are accurate, refer directly to the online help script -s option.