Question
· Jan 26, 2021

Individual Backup List for every Backup Task

Currently running on limited hardware, Online Backups are becoming a bottleneck for our system.

For now, we are exploring an option to backup individual databases, or groups of them, thus reducing RAM requirements per individual backup task. To do that, however, we'd need a separate Backup List for our Backup Tasks. We did not find an option to do so in web portal, so currently we are looking at inheriting from system backup tasks and Backup.General classes to generate Backup List before backing up and then performing the backup as normal.

Is this approach feasible? Would there be any issues if we tried to recover using multiple backup files (provided there are no collisions over which databases are backed up in each)

Product version: Caché 2018.1
Discussion (3)1
Log in or sign up to continue

Hi Evgenii,

Individual backup of each database or group of databases is possible through a custom routine. Below is the code of one of the routine we used long time back to split database backup to multiple disks. You just need to mention database names in each dblist. But as Dmitriy mentioned external backup (snapshot) is the best approach to follow.

// ***********
ZBACKUP      // Multiple Enviroment Backup Routine     
     // Start Backup of Individual Enviroments
    do dblist1           //Backup DB-A, DB-B, DB-C (do dblist1^ZBACKUP)
    do dblist2           //Backup DB-D, DB-E (do dblist2^ZBACKUP)     
    do dblist3        //Backup DB-F, DB-G, DB-H, DB-I (do dblist3^ZBACKUP)
    quit 

dblist1
        S TYPE="F"        ;'C'umlative incremental, 'F'ull, 'E'xternal full backup
     S DESCR="Full Backup"   ; Free form text string, may be NULL This is stored in the backup label and in the history global and describes the backup
     S MODE="NOISY"         ; "NOISY" - Default, print all text on terminal. "QUIET" - Only display text related to abnormal conditions
    S KILJRN="Y"        ; "Y" Switch the journal file after backup "N" ignored
    S CLRJRN="Y"        ; "Y" - Switch the journal file. "N" - ignored
    S SWJRN="Y"         ; "Y" - Switch the journal file after backup "N" - Do not switch the journal file. Note that this is overridden if clrjrn or kiljrn is "Y"      S BACKUPPATH="Path_to-Backup_Directory"
     S LOGPATH="Path_to_Backup-Log_Directory" 
     s DB="DB-A_DB-B_DB-C_"
      s DATE=$ZD($H,8)_"_"_$tr($zt($p($h,",",2),1),":","")
      s BKPFILE=BACKUPPATH_DB_DATE_".cbk"
     s LOGFILE=LOGPATH_DB_DATE_".log"
     s INTTIME=$p($h,",",2)      //PURGE Database List
    do ##class(Backup.General).ClearDatabaseList()      //Populate Database List
    s bkp=##class(Backup.General).AddDatabaseToList("DB-A")
    s bkp=##class(Backup.General).AddDatabaseToList("DB-B")
    s bkp=##class(Backup.General).AddDatabaseToList("DB-C")         //Perform Backup
        D BACKUP^DBACK("",TYPE,DESCR,BKPFILE,KILJRN,LOGFILE,MODE,CLRJRN,SWJRN,"") ;BACKUP(argfile,EXTTYP,DESCRIPTION,outdev,kiljrn,logfile,mode,clrjrn,swjrn,nwjrnfil,quietimeout,taskname)
    do ##class(Backup.General).ClearDatabaseList()         
    quit

dblist2
        S TYPE="F"        ;'C'umlative incremental, 'F'ull, 'E'xternal full backup
     S DESCR="Full Backup"   ; Free form text string, may be NULL This is stored in the backup label and in the history global and describes the backup
     S MODE="NOISY"         ; "NOISY" - Default, print all text on terminal. "QUIET" - Only display text related to abnormal conditions
    S KILJRN="Y"        ; "Y" Switch the journal file after backup "N" ignored
    S CLRJRN="Y"        ; "Y" - Switch the journal file. "N" - ignored
    S SWJRN="Y"         ; "Y" - Switch the journal file after backup "N" - Do not switch the journal file. Note that this is overridden if clrjrn or kiljrn is "Y"      S BACKUPPATH="Path_to-Backup_Directory"
     S LOGPATH="Path_to_Backup-Log_Directory" 
     s DB="DB-D_DB-E_"
      s DATE=$ZD($H,8)_"_"_$tr($zt($p($h,",",2),1),":","")
      s BKPFILE=BACKUPPATH_DB_DATE_".cbk"
     s LOGFILE=LOGPATH_DB_DATE_".log"
     s INTTIME=$p($h,",",2)      //PURGE Database List
    do ##class(Backup.General).ClearDatabaseList()      //Populate Database List
    s bkp=##class(Backup.General).AddDatabaseToList("DB-D")
    s bkp=##class(Backup.General).AddDatabaseToList("DB-E")     //Perform Backup
    D BACKUP^DBACK("",TYPE,DESCR,BKPFILE,KILJRN,LOGFILE,MODE,CLRJRN,SWJRN,"") ;BACKUP(argfile,EXTTYP,DESCRIPTION,outdev,kiljrn,logfile,mode,clrjrn,swjrn,nwjrnfil,quietimeout,taskname)
    do ##class(Backup.General).ClearDatabaseList()         
    quit

dblist3
        S TYPE="F"        ;'C'umlative incremental, 'F'ull, 'E'xternal full backup
     S DESCR="Full Backup"   ; Free form text string, may be NULL This is stored in the backup label and in the history global and describes the backup
     S MODE="NOISY"         ; "NOISY" - Default, print all text on terminal. "QUIET" - Only display text related to abnormal conditions
    S KILJRN="Y"        ; "Y" Switch the journal file after backup "N" ignored
    S CLRJRN="Y"        ; "Y" - Switch the journal file. "N" - ignored
    S SWJRN="Y"         ; "Y" - Switch the journal file after backup "N" - Do not switch the journal file. Note that this is overridden if clrjrn or kiljrn is "Y"      S BACKUPPATH="Path_to-Backup_Directory"
     S LOGPATH="Path_to_Backup-Log_Directory" 
     s DB="DB-F_DB-G_DB-H_DB-I_"
      s DATE=$ZD($H,8)_"_"_$tr($zt($p($h,",",2),1),":","")
      s BKPFILE=BACKUPPATH_DB_DATE_".cbk"
     s LOGFILE=LOGPATH_DB_DATE_".log"
     s INTTIME=$p($h,",",2)      //PURGE Database List
    do ##class(Backup.General).ClearDatabaseList()      //Populate Database List
    s bkp=##class(Backup.General).AddDatabaseToList("DB-F")
    s bkp=##class(Backup.General).AddDatabaseToList("DB-G")
    s bkp=##class(Backup.General).AddDatabaseToList("DB-H")
    s bkp=##class(Backup.General).AddDatabaseToList("DB-I")     //Perform Backup
    D BACKUP^DBACK("",TYPE,DESCR,BKPFILE,KILJRN,LOGFILE,MODE,CLRJRN,SWJRN,"") ;BACKUP(argfile,EXTTYP,DESCRIPTION,outdev,kiljrn,logfile,mode,clrjrn,swjrn,nwjrnfil,quietimeout,taskname)
    do ##class(Backup.General).ClearDatabaseList()         
    quit
// ***********