$!-----------------------------------------------------------------'f$verify(0) $! CLONE.COM $! $! This procedure creates another DCL procedure that contains ZIP commands to $! archive selected portions of the current system's WASD_ROOT:[000000] tree. $! That archive can then be restored on some other system avoiding the full $! installation process and providing a site-specific server environment. $! $! By default archive procedures and archives are created in the current $! directory, so to place these in [LOCAL] use $! $! $ SET DEFAULT WASD_ROOT:[LOCAL] $! $ @[INSTALL]CLONE $! $! then to create the ZIP archive in the same directory $! $ @[INSTALL]CLONE_WASD $! $! Copyright (C) 1996-2021 Mark G.Daniel. $! $! Licensed under the Apache License, Version 2.0 (the "License"); $! you may not use this file except in compliance with the License. $! You may obtain a copy of the License at $! $! http://www.apache.org/licenses/LICENSE-2.0 $! $! Unless required by applicable law or agreed to in writing, software $! distributed under the License is distributed on an "AS IS" BASIS, $! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. $! See the License for the specific language governing permissions and $! limitations under the License. $! $! 18-OCT-2021 MGD v12.0.0, +X86_64, -VAX supports $! 22-JUN-2020 MGD v11.5.0, documentation via wasDOC $! 07-NOV-2009 MGD v10.0.0, logical naming schema $! 14-SEP-2007 MGD up-case procedure spec to avoid mixed-case issues $! 23-DEC-2003 MGD IA64 support $! 25-NOV-2002 MGD initial $!----------------------------------------------------------------------------- $! $ if f$trnlnm("CLONE$DBUG") .nes. "" then set verify $! $ ss$_abort = 44 $ ss$_bugcheck = 676 $ say = "write sys$output" $ vms_version = f$integer(f$extract(1,1,f$getsyi("version"))) * 10 +- f$integer(f$extract(3,1,f$getsyi("version"))) $ if vms_version .ge. 72 then set process /parse=traditional $ set control=Y $ on controly then exit ss$_abort $! $ defaultProcedure = "CLONE_WASD.COM" $ procCom = f$element(0,";",f$edit(f$environment("procedure"),"upcase")) $ ftime = f$extract(0,17,f$time()) $! $ if f$environment("depth") .eq. 1 then @wasd_root:[install]copyright.com $! $ type sys$input *********************** * CLONE THE PACKAGE * *********************** This utility creates a separate DCL procedure containing ZIP commands to archive specified portions of the current system's WASD_ROOT:[000000] tree. That procedure can then be executed to create an archive which may then be UNZIPed on any other system(s) to create a copy of the original. In this way multiple WASD packages can be deployed without going through the full installation process and using the original as a working template. Some portions of the package are essential to any working installation. These are always archived. Others are prompted for and commands to archive those are only added to the procedure if required. Multiple such procedures may be created by specifying unique archive procedure names. $ response = "" $ read sys$command response /prompt="Create a cloning procedure? [NO]: " $ say "" $ if .not. response then exit $! $ type sys$input ************************ * DCL PROCEDURE NAME * ************************ If multiple cloning procedures are required enter a specific file name, otherwise use the default. $ response = "" $ read sys$command response /prompt="DCL procedure? [''defaultProcedure']: " $ say "" $ if response .eqs. "" then response = defaultProcedure $ zipProcedure = response + ";" - ".COM;" + ".COM" $ zipArchive = response + ";" - ".COM;" + ".ZIP" $! $ axpDetected = 0 $ ia64Detected = 0 $ x86Detected = 0 $ if f$search("WASD_ROOT:[AXP]*.EXE") .nes. "" then axpDetected = 1 $ if f$search("WASD_ROOT:[IA64]*.EXE") .nes. "" then ia64Detected = 1 $ if f$search("WASD_ROOT:[X86_64]*.EXE") .nes. "" then x86Detected = 1 $ archCount = 0 $ if axpDetected then archCount = archCount + 1 $ if ia64Detected then archCount = archCount + 1 $ if x86Detected then archCount = archCount + 1 $! $ type sys$input ****************** * ARCHITECTURE * ****************** $ if archCount .eq. 0 $ then $ type sys$input No files detected in any of [AXP], [IA64] or [X86_64]. This does not make sense! $ exit ss$_abort $ endif $ if archCount .gt. 1 $ then $ type sys$input Executables for multiple architectures ([AXP], [IA64], [X86_64]) detected. $ addAxp = 0 $ if axpDetected $ then $ response = "" $ read sys$command response /prompt="Add [AXP] executables? [NO]: " $ say "" $ if response then addAxp = 1 $ endif $ addIa64 = 0 $ if ia64Detected $ then $ response = "" $ read sys$command response /prompt="Add [IA64] executables? [NO]: " $ say "" $ if response then addIa64 = 1 $ endif $ addX86 = 0 $ if x86Detected $ then $ response = "" $ read sys$command response /prompt="Add [X86_64] executables? [NO]: " $ say "" $ if response then addX86 = 1 $ endif $ else $ addAxp = 0 $ addIa64 = 0 $ addX86 = 0 $ if axpDetected $ then $ say "Will be using [AXP] executables." $ addAxp = 1 $ endif $ if ia64Detected $ then $ say "Will be using [IA64] executables." $ addIa64 = 1 $ endif $ if x86Detected $ then $ say "Will be using [X86_64] executables." $ addX86 = 1 $ endif $ say "" $ endif $ response = "" $ read sys$command response /prompt="Continue? [NO]: " $ say "" $ if .not. response then exit $! $ type sys$input *************** * ESSENTIAL * *************** These directories and files are essential and always included: $ if addAxp $ then $ type sys$input [AXP] HTTPD.EXE HTTPD_SSL.EXE HTTPDMON.EXE SECHAN.EXE [AXP-BIN] Alpha script executables $ endif $ type sys$input [CGI-BIN] architecture-neutral script files [HTTP$NOBODY] server account home [HTTP$SERVER] scripting account home $ if addIa64 $ then $ type sys$input [IA64] HTTPD.EXE HTTPD_SSL.EXE HTTPDMON.EXE SECHAN.EXE [IA64-BIN] IA64 script executables $ endif $ type sys$input [INSTALL] installation, update and security procedures [LOCAL] local configuration files [LOG] access logs [LOG_SERVER] server process logs [RUNTIME.HTTPD] server runtime files (directory listing graphics, etc) [SCRATCH] scripting scratch space [STARTUP] startup procedures (STARTUP*.COM) $ if addX86 $ then $ type sys$input [X86_64] HTTPD.EXE HTTPD_SSL.EXE HTTPDMON.EXE SECHAN.EXE [X86_64-BIN] X86_64 script executables $ endif $ type sys$input Most directories retain some files (e.g. .WWW_HIDDEN, READMEs) but are only optionally populated with other files as requested. $ response = "" $ read sys$command response /prompt="Continue? [NO]: " $ say "" $ if .not. response then exit $! $ type sys$input ******************* * CONFIGURATION * ******************* Files from [LOCAL]*.conf (e.g. HTTPD$CONFIG, HTTPD$MAP, etc.) $ response = "" $ read sys$command response /prompt="Add? [NO]: " $ say "" $ addConfig = 0 $ if response then addConfig = 1 $! $ type sys$input ************* * SCRIPTS * ************* Files from [CGI-BIN] and executables from [AXP-BIN] and/or [IA64-BIN] and/or [X86_64-BIN]. Note that this adds ALL files from these directories. Of course you can manually edit the resultant procedure to remove unwanted items. This also adds the rest of the files from the [RUNTIME...] directory tree (remembering that [RUNTIME.HTTPD] is included with the essential files). $ response = "" $ read sys$command response /prompt="Add? [NO]: " $ say "" $ addScript = 0 $ if response then addScript = 1 $! $ type sys$input ******************* * DOCUMENTATION * ******************* Files from [WASDDOC...]*.* $ response = "" $ read sys$command response /prompt="Add? [NO]: " $ say "" $ addDocumentation = 0 $ if response then addDocumentation = 1 $! $ type sys$input ************************ * EXAMPLE & EXERCISE * ************************ Files from [EXAMPLE]*.* and [EXERCISE]*.*. $ response = "" $ read sys$command response /prompt="Add? [NO]: " $ say "" $ addExampleExercise = 0 $ if response then addExampleExercise = 1 $! $ type sys$input ************ * SOURCE * ************ Files from [SRC...]*.*. $ response = "" $ read sys$command response /prompt="Add? [NO]: " $ say "" $ addSource = 0 $ if response then addSource = 1 $ if addSource $ then $ response = "" $ read sys$command response /prompt="Include object modules? [NO]: " $ say "" $ addSourceObjects = 0 $ if response then addSourceObjects = 1 $ endif $! $ type sys$input ******************************** * CREATING ARCHIVE PROCEDURE * ******************************** $ if f$trnlnm("ZIPF","LNM$PROCESS") .nes. "" then close zipf $ open /write zipf 'zipProcedure' $ wzipf = "write zipf" $! $ wzipf "$! ''zipProcedure' created by ''procCom' at ''ftime'" $ wzipf "$!" $ wzipf "$ write sys$output """"" $ wzipf "$ write sys$output ""''zipProcedure' created by ''procCom' at ''ftime'""" $ wzipf "$ write sys$output """"" $ wzipf "$!" $ wzipf "$ define /user sys$output nl:" $ wzipf "$ define /user sys$error nl:" $ wzipf "$ zip -h" $ wzipf "$ if .not. $status then exit $status" $ wzipf "$!" $ wzipf "$ zipName = """"" $ wzipf "$ read sys$command zipName /prompt=""ZIP archive name? [''zipArchive']: """ $ wzipf "$ if zipName .eqs. """" then zipName = ""''zipArchive'""" $ wzipf "$ zipName = f$element(0,"";"",f$parse(zipName))" $ wzipf "$ if f$search(zipName) .nes. """"" $ wzipf "$ then" $ wzipf "$ write sys$output """"" $ wzipf "$ write sys$output ""Any existing archives should be deleted!""" $ wzipf "$ delete = ""delete/confirm""" $ wzipf "$ delete " + "'" + "zipName" + "'" + ";*" $ wzipf "$ endif" $ wzipf "$!" $ wzipf "$ wasdRootParent = f$trnlnm(""WASD_ROOT"",,""no_conceal"")" $ wzipf "$ wasdRootParent = wasdRootParent - "".]"" + "".-]""" $ wzipf "$ currentDefault = f$environment(""default"")" $ wzipf "$ set control=y" $ wzipf "$ on controly then goto tidyup" $ wzipf "$ set default " + "'" + "wasdRootParent" + "'" $ wzipf "$ write sys$output """"" $ wzipf "$ write sys$output ""Parent directory for WASD_ROOT is "" + f$environment(""default"")" $ wzipf "$ write sys$output """"" $ wzipf "$ set noon" $! $ zipv = """$ ZIP """"-V"""" " + "'" + "zipName" + "'" + " """ $ zipt = """$ ZIP """"-T"""" " + "'" + "zipName" + "'" + " """ $ zipd = """$!! ZIP """"-d"""" " + "'" + "zipName" + "'" + " """ $! $ wzipf "$!" $ wzipf "$! essential directories and files" $ wzipf 'zipv' + "[.WASD_ROOT.CGI-BIN]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.CGI-BIN].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.HTTP$NOBODY]LOGIN.COM" $ wzipf 'zipv' + "[.WASD_ROOT.HTTP$NOBODY]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.HTTP$NOBODY].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.HTTP$SERVER]LOGIN.COM" $ wzipf 'zipv' + "[.WASD_ROOT.HTTP$SERVER]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.HTTP$SERVER].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.INSTALL]*.COM" $ wzipf 'zipv' + "[.WASD_ROOT.INSTALL]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.LOCAL]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.LOCAL].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.LOG]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.LOG].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.LOG_SERVER]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.LOG_SERVER].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.SCRATCH]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.SCRATCH].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.STARTUP]*.COM -x *LATEST.COM" $ wzipf 'zipv' + "[.WASD_ROOT.STARTUP]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.STARTUP].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.RUNTIME.HTTPD]*.*" $ if addConfig $ then $ wzipf "$!" $ wzipf "$! configuration files" $ wzipf 'zipv' + "[.WASD_ROOT.LOCAL]*.CONF" $ endif $ if addAxp $ then $ wzipf "$!" $ wzipf "$! Alpha (AXP) architecture directories and essential executables" $ wzipf 'zipv' + "[.WASD_ROOT.AXP-BIN]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.AXP-BIN].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.AXP]HTTPD.EXE" $ wzipf 'zipv' + "[.WASD_ROOT.AXP]HTTPD_SSL.EXE" $ wzipf 'zipv' + "[.WASD_ROOT.AXP]HTTPDMON.EXE" $ wzipf 'zipv' + "[.WASD_ROOT.AXP]SECHAN.EXE" $ endif $ if addIa64 $ then $ wzipf "$!" $ wzipf "$! IA64 architecture directories and essential executables" $ wzipf 'zipv' + "[.WASD_ROOT.IA64-BIN]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.IA64-BIN].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.IA64]HTTPD.EXE" $ wzipf 'zipv' + "[.WASD_ROOT.IA64]HTTPD_SSL.EXE" $ wzipf 'zipv' + "[.WASD_ROOT.IA64]HTTPDMON.EXE" $ wzipf 'zipv' + "[.WASD_ROOT.IA64]SECHAN.EXE" $ endif $ if addX86 $ then $ wzipf "$!" $ wzipf "$! X86_64 architecture directories and essential executables" $ wzipf 'zipv' + "[.WASD_ROOT.X86_64-BIN]README.*" $ wzipf 'zipv' + "[.WASD_ROOT.X86_64-BIN].WWW_*" $ wzipf 'zipv' + "[.WASD_ROOT.X86_64]HTTPD.EXE" $ wzipf 'zipv' + "[.WASD_ROOT.X86_64]HTTPD_SSL.EXE" $ wzipf 'zipv' + "[.WASD_ROOT.X86_64]HTTPDMON.EXE" $ wzipf 'zipv' + "[.WASD_ROOT.X86_64]SECHAN.EXE" $ endif $ if addScript $ then $ wzipf "$!" $ wzipf "$! script files" $ wzipf 'zipv' + "[.WASD_ROOT.CGI-BIN]*.*" $ if addAxp then wzipf 'zipv' + "[.WASD_ROOT.AXP-BIN]*.*" $ if addIa64 then wzipf 'zipv' + "[.WASD_ROOT.IA64-BIN]*.*" $ if addX86 then wzipf 'zipv' + "[.WASD_ROOT.X86_64-BIN]*.*" $ wzipf 'zipv' + "[.WASD_ROOT.RUNTIME...]*.* -x [.WASD_ROOT.RUNTIME.HTTPD]*" $ endif $ if addDocumentation $ then $ wzipf "$!" $ wzipf "$! wasDOC documentation" $ wzipf 'zipv' + "[.WASD_ROOT.WASDOC...]*.* $ endif $ if addExampleExercise $ then $ wzipf "$!" $ wzipf "$! examples and exercise" $ wzipf 'zipv' + "[.WASD_ROOT.EXAMPLE...]*.*" $ wzipf 'zipv' + "[.WASD_ROOT.EXERCISE...]*.*" $ endif $ if addSource $ then $ wzipf "$!" $ if addSourceObjects $ then $ wzipf "$! source files (including object modules)" $ wzipf 'zipv' + "[.WASD_ROOT.SRC...]*.*" $ else $ wzipf "$! source files (excluding object modules)" $ wzipf 'zipv' + "[.WASD_ROOT.SRC...]*.* -x *.OBJ" $ endif $ endif $ wzipf "$!" $ wzipf "$! example ZIP command to delete unwanted item(s)" $ wzipf 'zipd' + "[.WASD_ROOT.CGI-BIN]CGI_SYMBOLS.COM" $ wzipf "$!" $ wzipf "$ write sys$output """"" $ wzipf "$! test integrity of archive" $ wzipf 'zipt' $ wzipf "$!" $ wzipf "$ set protection=w " + "'" + "zipName" + "'" $ wzipf "$!" $ wzipf "$ tidyup:" $ wzipf "$ set default " + "'" + "currentDefault" + "'" $ wzipf "$ write sys$output """"" $! $ close zipf $ set protection=w 'zipProcedure' $ say "Created " + f$search("''zipProcedure'") $ type sys$input The contents of this procedure can be manually modified and/or other command lines added to archive or remove specific areas and/or files. ********************* * C O M P L E T E * ********************* $!-----------------------------------------------------------------------------