Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BKUCW2KV

BKUCW2KV.m

Go to the documentation of this file.
  1. BKUCW2KV ;TASSC/MFD set variables for Cache Win2k backup [ 11/17/2002 9:07 PM ]
  1. ;;1.59;W2KCABACKUP;;
  1. VARS ;
  1. ;***** HOST OS PATH SECTION ********
  1. ;This is a freeze only version.
  1. ;NOTE the Cache install directory should be added to the system PATH
  1. ;***** PATH SECTION ********
  1. ;Define which paths contain database volumes in an array and your
  1. ;Journal directory
  1. S BKUPATH(0)="D:\Cache\TRG"
  1. S BKUPATH(1)="D:\JRN"
  1. S BKUPATH(2)="D:\cachesys"
  1. S BKUPATH(3)="D:\Cache\CAL"
  1. S BKUPATH(4)="D:\Cache\TST"
  1. ;Define where you are copying to-array subscripts must match BKUPATH
  1. ;AND the "to" folders must already exist!
  1. S CPTODIR(0)="D:\cachebackup\TRG"
  1. S CPTODIR(1)="D:\jrnbackup"
  1. S CPTODIR(2)="D:\cachesysbackup"
  1. S CPTODIR(3)="D:\cachebackup\CAL"
  1. S CPTODIR(4)="D:\cachebackup\TST"
  1. ;
  1. S (BKUPDRV,I)="" F S I=$O(CPTODIR(I)) Q:I="" S BKUPDRV=BKUPDRV_CPTODIR(I)_" "
  1. ;Default is to backup what is in CPTODIR but you can backup entire
  1. ;drives by uncommenting and editing one of the lines below
  1. ;S BKUPDRV="C:\"
  1. ;S BKUPDRV="D:\" ;to get entire C, E, F, D, and G drives- except for files inuse
  1. ;
  1. ;****** MISCELLANEOUS ******
  1. S SENDTOID="" ;to ftp the results file
  1. S MAILTOID="HELPDESK@DOMAIN.NAME" ;email results file
  1. S MAILFROMID="HELPDESK@DOMAIN.NAME" ;address email is from- must be defined
  1. S MAILTOID="@c:\winnt\wsendmaillist.txt" ;email results file to a list
  1. ;S PREVKILL="yes" D NOKILL ;prevent kill of glbs; Don't uncomment, doesn't work with Cache
  1. ;S NOVAL=1 ;uncomment to skip Validate- NOT RECOMMENDED!
  1. S NOSSD=1 ;to avoid SSD on error- FOR TESTING ONLY!
  1. ;S BKUHANG=300 ;uncomment to extend buffer flush hang, 60 is dflt
  1. ;
  1. ;S BKURTIME=2100 ; 9pm, set to military run time for Shadow server and no Taskman
  1. S BKUSITE="Phoenix Training System" ; set to site name for addition to mail message subject
  1. ;
  1. ;The variable values below are standard and should not be changed
  1. S CDIR=$P($ZU(131,1),",",2),CDIR=$P(CDIR,"\mgr")
  1. S HOSTNAME="%COMPUTERNAME%"
  1. S:'$D(BKUSITE) BKUSITE=HOSTNAME
  1. S SENDFILE=CDIR_"\backup_cawin."_HOSTNAME
  1. S VALFILE=CDIR_"\backup_cawin.RESULTS"
  1. S INTFILE=CDIR_"\backup_cawin.INTEGRIT" ; this is appended to Results file if an error
  1. S INTEGAPP="" ;uncomment to get Integr check result appended to Results file every run
  1. S CUMFILE=CDIR_"\backup_cawin.CUM"
  1. S TMPCUM=CUMFILE_".tmp"
  1. ;S TRSHOOT="yes" ;do not use, for test purposes only
  1. ;
  1. ;****** TAPE BACKUP SECTION ******
  1. ;S NOTAPE=1 ;uncomment to skip tape backup and do disk-to-disk only
  1. S TAPEDRV="""DLT""" D TLIB ;set your tape drive type, e.g. DLT, 4mm, LTO Ultrium
  1. ;S TAPEDRV="""4mm DDS""" D TLIB ;set your tape drive type, e.g. DLT, 4mm
  1. ;Define Windows-level tape backup command
  1. S TVERIFY="yes" ;change to no to skip tape verify-NOT RECOMMENDED!
  1. S TBKUPCMD="ntbackup backup systemstate" ;get system state (registry) also
  1. ;S TBKUPCMD="ntbackup backup" ;don't backup system state (registry)
  1. S TBKUPJOB="""RPMS Backup on "_$ZD($P($H,","),5)_" at "_$H_""""
  1. 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"
  1. 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"
  1. ;
  1. ;
  1. ;***** DEL/COPY SECTION ******
  1. ;Set Delete cmd to use
  1. S DELCMD="del /q /s "
  1. S DELCMDOP="\*.*"
  1. ;Set Copy cmd to use-
  1. ;found xcopy to be slightly faster than copy
  1. ;and scopy won't copy an open file
  1. S NTCPCMD="xcopy"
  1. S NTCPOPT="/s /e /f" ;xcopy options-copy any subdirs and data in them
  1. ;
  1. ;****** CACHE VARS SECTION ******
  1. D RPATH ; add %SYS to routine search path
  1. S SYS=$ZU(110)
  1. S USR=$ZU(67,11,$J)
  1. ;
  1. K I Q ;the end
  1. ;
  1. ;
  1. TLIB ;get tape library name
  1. ;required to run rsm refresh command to activate a changed tape
  1. N X,Y S Y="tapelib.txt"
  1. S X=$ZF(-1,"rsm view /tlibrary|qgrep Drive >"_CDIR_"\tapelib.txt")
  1. O CDIR_"\"_Y:"R"
  1. U CDIR_"\"_Y R TAPELIB
  1. C CDIR_"\"_Y K X
  1. S TAPELIB=""_TAPELIB_""
  1. S TAPEREF="start /wait rsm.exe refresh /lf"""_TAPELIB_""""
  1. S X=$$DEL^%ZISH(CDIR,Y)
  1. Q
  1. ;
  1. RPATH ; set the Namespace path to include %SYS
  1. S BKUNSP=$ZU(20,$ZU(20),"%SYS") ;set routine search path to include %SYS
  1. Q
  1. ;
  1. NOPATH ; set path back to just IHS or PRD
  1. S BKUNSP=$ZU(20,BKUNSP)
  1. Q
  1. ;
  1. ;
  1. ; Subs below not currently used for Cache backups
  1. ; Currently when a user logs in, a switch is set to disallow top level kills
  1. ; in LOGIN^%ZSTART, to allow kill for the process so I $ZU(68,28,0)
  1. ;
  1. NOKILL ; set ^BKUVARS to prevent global kills
  1. K ^BKUVARS("PREVENTKILL"),^("ALLOWKILL")
  1. N BKUGL,BKUPROD
  1. S BKUPROD=^%ZOSF("PROD")
  1. S ^BKUVARS("PREVENTKILL")="PREVKILL=""yes""" D BKUGBL
  1. Q
  1. BKUGBL ; set ^BKUVARS to allow kill of globals listed in GBLS
  1. N BKUI,BKUX,BKUGLB
  1. F BKUI=1:1 S BKUX=$T(GLBS+BKUI) Q:$E(BKUX)'=" " S BKUGLB=$P(BKUX,";;",2) D
  1. .I BKUGLB'["[" S BKUGLB="["""_^%ZOSF("PROD")_"""]"_BKUGLB
  1. .S BKUGLB="^"_BKUGLB
  1. .I $D(BKUGLB) S ^BKUVARS("ALLOWKILL",$P(BKUGLB,"^",2))=""
  1. Q
  1. GLBS ;
  1. ;;ACHSPCC
  1. ;;ACHSBCBS
  1. ;;ACHSAOPD
  1. ;;ACHSAOVU
  1. ;;ACHSZOCT
  1. ;;ACHSPIG
  1. ;;ACHSSVR
  1. ;;ACHSEOBR
  1. ;;ACHSLOG
  1. ;;ACHSDATA
  1. ;;ACHSTXPT
  1. ;;ACHSTXVN
  1. ;;ACHSTXOB
  1. ;;ACHSTXPD
  1. ;;ACHSTXPG
  1. ;;ACHSUSE
  1. ;;BWOLD
  1. ;;AFSHCANP
  1. ;;AFSHCANR
  1. ;;AFSLARCX
  1. ;;AFSLEMSG
  1. ;;AFSLJCL
  1. ;;AFSLMSGX
  1. ;;AFSLODOC
  1. ;;AFSLREJT
  1. ;;AFSLTDOC
  1. ;;AFSLTPF
  1. ;;AFSLZEIN
  1. ;;AFSLZUM1
  1. ;;AFSLZUM2
  1. ;;AFSLVNDR
  1. ;;AFSNEXE
  1. ;;AFSNRCDS
  1. ;;AFSPRPTQ
  1. ;;AQAJEXP
  1. ;;AQAQX
  1. ;;AQAQP
  1. ;;AQAOX
  1. ;;AQAOXX
  1. ;;ADGX
  1. ;;AGTXER
  1. ;;AGCHDFN
  1. ;;HEPDL
  1. ;;FREEZE