BKUCW2KV ;TASSC/MFD set variables for Cache Win2k backup [ 11/17/2002 9:07 PM ]
;;1.59;W2KCABACKUP;;
VARS ;
;***** HOST OS PATH SECTION ********
;This is a freeze only version.
;NOTE the Cache install directory should be added to the system PATH
;***** PATH SECTION ********
;Define which paths contain database volumes in an array and your
;Journal directory
S BKUPATH(0)="D:\TRG"
S BKUPATH(1)="C:\Jrn"
S BKUPATH(2)="D:\CacheSys"
;Define where you are copying to-array subscripts must match BKUPATH
;AND the "to" folders must already exist!
S CPTODIR(0)="D:\TRGBACKUP"
S CPTODIR(1)="D:\JRNBACKUP"
S CPTODIR(2)="D:\CacheSysbackup"
;
S (BKUPDRV,I)="" F S I=$O(CPTODIR(I)) Q:I="" S BKUPDRV=BKUPDRV_CPTODIR(I)_" "
;Default is to backup what is in CPTODIR but you can backup entire
;drives by uncommenting and editing one of the lines below
;S BKUPDRV="C:\"
S BKUPDRV="C:\ E:\ F:\ D:\ G:\" ;to get entire C, E, F, D, and G drives- except for files inuse
;
;****** MISCELLANEOUS ******
S SENDTOID="" ;to ftp the results file
;S MAILTOID="mark.delaney@tassc.com" ;email results file
S MAILFROMID="rick.pullen@ihs.gov" ;address email is from- must be defined
S MAILTOID="@c:\winnt\wsendmaillist.txt" ;email results file to a list
;S PREVKILL="yes" D NOKILL ;prevent kill of glbs; Don't uncomment, doesn't work with Cache
;S NOVAL=1 ;uncomment to skip Validate- NOT RECOMMENDED!
S NOSSD=1 ;to avoid SSD on error- FOR TESTING ONLY!
;S BKUHANG=300 ;uncomment to extend buffer flush hang, 60 is dflt
;
;S BKURTIME=2100 ; 9pm, set to military run time for Shadow server and no Taskman
;S BKUSITE="sitename" ; set to site name for addition to mail message subject
;
;The variable values below are standard and should not be changed
S CDIR=$P($ZU(131,1),",",2),CDIR=$P(CDIR,"\mgr")
S HOSTNAME="%COMPUTERNAME%"
S:'$D(BKUSITE) BKUSITE=HOSTNAME
S SENDFILE=CDIR_"\backup_cawin."_HOSTNAME
S VALFILE=CDIR_"\backup_cawin.RESULTS"
S INTFILE=CDIR_"\backup_cawin.INTEGRIT" ; this is appended to Results file if an error
S INTEGAPP="" ;uncomment to get Integr check result appended to Results file every run
S CUMFILE=CDIR_"\backup_cawin.CUM"
S TMPCUM=CUMFILE_".tmp"
;S TRSHOOT="yes" ;do not use, for test purposes only
;
;****** TAPE BACKUP SECTION ******
;S NOTAPE=1 ;uncomment to skip tape backup and do disk-to-disk only
S TAPEDRV="""DLT""" D TLIB ;set your tape drive type, e.g. DLT, 4mm, LTO Ultrium
;S TAPEDRV="""4mm DDS""" D TLIB ;set your tape drive type, e.g. DLT, 4mm
;Define Windows-level tape backup command
S TVERIFY="yes" ;change to no to skip tape verify-NOT RECOMMENDED!
S TBKUPCMD="ntbackup backup systemstate" ;get system state (registry) also
;S TBKUPCMD="ntbackup backup" ;don't backup system state (registry)
S TBKUPJOB="""RPMS Backup on "_$ZD($P($H,","),5)_" at "_$H_""""
S TBKUPOPT="/N "_TBKUPJOB_" /d """_$G(BKUPDRV)_" plus System State"" /v:yes /r:no /rs:no /hc:on /m normal /l:s /p "_TAPEDRV_" /um"
S:TVERIFY="no" TBKUPOPT="/N "_TBKUPJOB_" /d """_$G(BKUPDRV)_"plus System State"" /v:no /r:no /rs:no /hc:on /m normal /l:s /p "_TAPEDRV_" /um"
;
;
;***** DEL/COPY SECTION ******
;Set Delete cmd to use
S DELCMD="del /q /s "
S DELCMDOP="\*.*"
;Set Copy cmd to use-
;found xcopy to be slightly faster than copy
;and scopy won't copy an open file
S NTCPCMD="xcopy"
S NTCPOPT="/s /e /f" ;xcopy options-copy any subdirs and data in them
;
;****** CACHE VARS SECTION ******
D RPATH ; add %SYS to routine search path
S SYS=$ZU(110)
S USR=$ZU(67,11,$J)
;
K I Q ;the end
;
;
TLIB ;get tape library name
;required to run rsm refresh command to activate a changed tape
N X,Y S Y="tapelib.txt"
S X=$ZF(-1,"rsm view /tlibrary|qgrep Drive >"_CDIR_"\tapelib.txt")
O CDIR_"\"_Y:"R"
U CDIR_"\"_Y R TAPELIB
C CDIR_"\"_Y K X
S TAPELIB=""_TAPELIB_""
S TAPEREF="start /wait rsm.exe refresh /lf"""_TAPELIB_""""
S X=$$DEL^%ZISH(CDIR,Y)
Q
;
RPATH ; set the Namespace path to include %SYS
S BKUNSP=$ZU(20,$ZU(20),"%SYS") ;set routine search path to include %SYS
Q
;
NOPATH ; set path back to just IHS or PRD
S BKUNSP=$ZU(20,BKUNSP)
Q
;
;
; Subs below not currently used for Cache backups
; Currently when a user logs in, a switch is set to disallow top level kills
; in LOGIN^%ZSTART, to allow kill for the process so I $ZU(68,28,0)
;
NOKILL ; set ^BKUVARS to prevent global kills
K ^BKUVARS("PREVENTKILL"),^("ALLOWKILL")
N BKUGL,BKUPROD
S BKUPROD=^%ZOSF("PROD")
S ^BKUVARS("PREVENTKILL")="PREVKILL=""yes""" D BKUGBL
Q
BKUGBL ; set ^BKUVARS to allow kill of globals listed in GBLS
N BKUI,BKUX,BKUGLB
F BKUI=1:1 S BKUX=$T(GLBS+BKUI) Q:$E(BKUX)'=" " S BKUGLB=$P(BKUX,";;",2) D
.I BKUGLB'["[" S BKUGLB="["""_^%ZOSF("PROD")_"""]"_BKUGLB
.S BKUGLB="^"_BKUGLB
.I $D(BKUGLB) S ^BKUVARS("ALLOWKILL",$P(BKUGLB,"^",2))=""
Q
GLBS ;
;;ACHSPCC
;;ACHSBCBS
;;ACHSAOPD
;;ACHSAOVU
;;ACHSZOCT
;;ACHSPIG
;;ACHSSVR
;;ACHSEOBR
;;ACHSLOG
;;ACHSDATA
;;ACHSTXPT
;;ACHSTXVN
;;ACHSTXOB
;;ACHSTXPD
;;ACHSTXPG
;;ACHSUSE
;;BWOLD
;;AFSHCANP
;;AFSHCANR
;;AFSLARCX
;;AFSLEMSG
;;AFSLJCL
;;AFSLMSGX
;;AFSLODOC
;;AFSLREJT
;;AFSLTDOC
;;AFSLTPF
;;AFSLZEIN
;;AFSLZUM1
;;AFSLZUM2
;;AFSLVNDR
;;AFSNEXE
;;AFSNRCDS
;;AFSPRPTQ
;;AQAJEXP
;;AQAQX
;;AQAQP
;;AQAOX
;;AQAOXX
;;ADGX
;;AGTXER
;;AGCHDFN
;;HEPDL
;;FREEZE
BKUCW2KV ;TASSC/MFD set variables for Cache Win2k backup [ 11/17/2002 9:07 PM ]
+1 ;;1.59;W2KCABACKUP;;
VARS ;
+1 ;***** HOST OS PATH SECTION ********
+2 ;This is a freeze only version.
+3 ;NOTE the Cache install directory should be added to the system PATH
+4 ;***** PATH SECTION ********
+5 ;Define which paths contain database volumes in an array and your
+6 ;Journal directory
+7 SET BKUPATH(0)="D:\TRG"
+8 SET BKUPATH(1)="C:\Jrn"
+9 SET BKUPATH(2)="D:\CacheSys"
+10 ;Define where you are copying to-array subscripts must match BKUPATH
+11 ;AND the "to" folders must already exist!
+12 SET CPTODIR(0)="D:\TRGBACKUP"
+13 SET CPTODIR(1)="D:\JRNBACKUP"
+14 SET CPTODIR(2)="D:\CacheSysbackup"
+15 ;
+16 SET (BKUPDRV,I)=""
FOR
SET I=$ORDER(CPTODIR(I))
IF I=""
QUIT
SET BKUPDRV=BKUPDRV_CPTODIR(I)_" "
+17 ;Default is to backup what is in CPTODIR but you can backup entire
+18 ;drives by uncommenting and editing one of the lines below
+19 ;S BKUPDRV="C:\"
+20 ;to get entire C, E, F, D, and G drives- except for files inuse
SET BKUPDRV="C:\ E:\ F:\ D:\ G:\"
+21 ;
+22 ;****** MISCELLANEOUS ******
+23 ;to ftp the results file
SET SENDTOID=""
+24 ;S MAILTOID="mark.delaney@tassc.com" ;email results file
+25 ;address email is from- must be defined
SET MAILFROMID="rick.pullen@ihs.gov"
+26 ;email results file to a list
SET MAILTOID="@c:\winnt\wsendmaillist.txt"
+27 ;S PREVKILL="yes" D NOKILL ;prevent kill of glbs; Don't uncomment, doesn't work with Cache
+28 ;S NOVAL=1 ;uncomment to skip Validate- NOT RECOMMENDED!
+29 ;to avoid SSD on error- FOR TESTING ONLY!
SET NOSSD=1
+30 ;S BKUHANG=300 ;uncomment to extend buffer flush hang, 60 is dflt
+31 ;
+32 ;S BKURTIME=2100 ; 9pm, set to military run time for Shadow server and no Taskman
+33 ;S BKUSITE="sitename" ; set to site name for addition to mail message subject
+34 ;
+35 ;The variable values below are standard and should not be changed
+36 SET CDIR=$PIECE($ZU(131,1),",",2)
SET CDIR=$PIECE(CDIR,"\mgr")
+37 SET HOSTNAME="%COMPUTERNAME%"
+38 IF '$DATA(BKUSITE)
SET BKUSITE=HOSTNAME
+39 SET SENDFILE=CDIR_"\backup_cawin."_HOSTNAME
+40 SET VALFILE=CDIR_"\backup_cawin.RESULTS"
+41 ; this is appended to Results file if an error
SET INTFILE=CDIR_"\backup_cawin.INTEGRIT"
+42 ;uncomment to get Integr check result appended to Results file every run
SET INTEGAPP=""
+43 SET CUMFILE=CDIR_"\backup_cawin.CUM"
+44 SET TMPCUM=CUMFILE_".tmp"
+45 ;S TRSHOOT="yes" ;do not use, for test purposes only
+46 ;
+47 ;****** TAPE BACKUP SECTION ******
+48 ;S NOTAPE=1 ;uncomment to skip tape backup and do disk-to-disk only
+49 ;set your tape drive type, e.g. DLT, 4mm, LTO Ultrium
SET TAPEDRV="""DLT"""
DO TLIB
+50 ;S TAPEDRV="""4mm DDS""" D TLIB ;set your tape drive type, e.g. DLT, 4mm
+51 ;Define Windows-level tape backup command
+52 ;change to no to skip tape verify-NOT RECOMMENDED!
SET TVERIFY="yes"
+53 ;get system state (registry) also
SET TBKUPCMD="ntbackup backup systemstate"
+54 ;S TBKUPCMD="ntbackup backup" ;don't backup system state (registry)
+55 SET TBKUPJOB="""RPMS Backup on "_$ZD($PIECE($HOROLOG,","),5)_" at "_$HOROLOG_""""
+56 SET TBKUPOPT="/N "_TBKUPJOB_" /d """_$GET(BKUPDRV)_" plus System State"" /v:yes /r:no /rs:no /hc:on /m normal /l:s /p "_TAPEDRV_" /um"
+57 IF TVERIFY="no"
SET TBKUPOPT="/N "_TBKUPJOB_" /d """_$GET(BKUPDRV)_"plus System State"" /v:no /r:no /rs:no /hc:on /m normal /l:s /p "_TAPEDRV_" /um"
+58 ;
+59 ;
+60 ;***** DEL/COPY SECTION ******
+61 ;Set Delete cmd to use
+62 SET DELCMD="del /q /s "
+63 SET DELCMDOP="\*.*"
+64 ;Set Copy cmd to use-
+65 ;found xcopy to be slightly faster than copy
+66 ;and scopy won't copy an open file
+67 SET NTCPCMD="xcopy"
+68 ;xcopy options-copy any subdirs and data in them
SET NTCPOPT="/s /e /f"
+69 ;
+70 ;****** CACHE VARS SECTION ******
+71 ; add %SYS to routine search path
DO RPATH
+72 SET SYS=$ZU(110)
+73 SET USR=$ZU(67,11,$JOB)
+74 ;
+75 ;the end
KILL I
QUIT
+76 ;
+77 ;
TLIB ;get tape library name
+1 ;required to run rsm refresh command to activate a changed tape
+2 NEW X,Y
SET Y="tapelib.txt"
+3 SET X=$ZF(-1,"rsm view /tlibrary|qgrep Drive >"_CDIR_"\tapelib.txt")
+4 OPEN CDIR_"\"_Y:"R"
+5 USE CDIR_"\"_Y
READ TAPELIB
+6 CLOSE CDIR_"\"_Y
KILL X
+7 SET TAPELIB=""_TAPELIB_""
+8 SET TAPEREF="start /wait rsm.exe refresh /lf"""_TAPELIB_""""
+9 SET X=$$DEL^%ZISH(CDIR,Y)
+10 QUIT
+11 ;
RPATH ; set the Namespace path to include %SYS
+1 ;set routine search path to include %SYS
SET BKUNSP=$ZU(20,$ZU(20),"%SYS")
+2 QUIT
+3 ;
NOPATH ; set path back to just IHS or PRD
+1 SET BKUNSP=$ZU(20,BKUNSP)
+2 QUIT
+3 ;
+4 ;
+5 ; Subs below not currently used for Cache backups
+6 ; Currently when a user logs in, a switch is set to disallow top level kills
+7 ; in LOGIN^%ZSTART, to allow kill for the process so I $ZU(68,28,0)
+8 ;
NOKILL ; set ^BKUVARS to prevent global kills
+1 KILL ^BKUVARS("PREVENTKILL"),^("ALLOWKILL")
+2 NEW BKUGL,BKUPROD
+3 SET BKUPROD=^%ZOSF("PROD")
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