home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Collection - Online Library - January 1996 / CKITOS2196.ISO / diskette / gg244043.dsk / unc.dsk / LS30UTIL / BXC4AS.CMD < prev    next >
OS/2 REXX Batch file  |  1993-03-03  |  4KB  |  103 lines

  1. /****************************************************************************/
  2. /* REXX LAN Server 3.0 Advanced XCOPY Backup procedure. BXC4AS.CMD          */
  3. /*                                                                          */
  4. /* The following parameters are required                                    */
  5. /*                                                                          */
  6. /*  copytype  The extent of the xcopy option                                */
  7. /*  landrive  The IBMLAN drive like for example C:                          */
  8. /*  destpath  The destination drive for XCOPY like X:\BACKUP\TODAY          */
  9. /*  logfile   The logfile path and file name                                */
  10. /*                                                                          */
  11. /****************************************************************************/
  12.  
  13. Parse Upper Arg copytype landrive destpath logfile
  14.  
  15. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  16. call SysLoadFuncs
  17.  
  18. SELECT
  19.  WHEN copytype='ALL'     THEN XC_OPT = '/S /E';
  20.  WHEN copytype='CHANGES' THEN XC_OPT = '/S /E /M';
  21.  OTHERWISE DO
  22.   CALL DSP_HELP;
  23.   EXIT 9
  24.  END
  25. END
  26.  
  27. /************************/
  28. /* Append to log file   */
  29. /************************/
  30. rc = LINEOUT(logfile,  'XCOPY of Server files started ' time() date() )
  31. if rc <> 0 then do
  32.  say 'Error opening ' logfile ' Program stopped'
  33.  EXIT 99
  34. END
  35.  
  36. /* Get local attached drives and perform BACKACC on them */
  37. Call "LINEOUT" logfile
  38. dMap = SysDriveMap('C:', 'LOCAL')
  39. i = 1
  40. do while (WORD(dMap,i) <> '')
  41.  'backacc ' word(dMap,i) || '\ /S'
  42.  i = i + 1
  43. end
  44. root = landrive || '\IBMLAN\'
  45. Call "LINEOUT" logfile,  'XCOPY of Access Control Profiles started '
  46. 'XCOPY ' root || 'ACCOUNTS\*.ACL ' destpath ||'\ACCOUNTS\*.* /S'
  47. 'XCOPY ' root || 'ACCOUNTS\*.BAK ' destpath ||'\ACCOUNTS\*.* /S'
  48. 'XCOPY ' root || 'ACCOUNTS\*.BKP ' destpath ||'\ACCOUNTS\*.* /S'
  49.  
  50. /* Is this a Domain Controller or Backup Domain Controller? */
  51. rc = SysMkDir(root || 'DCDB')
  52. if rc <> 0 then do
  53.  Call "LINEOUT" logfile,  'XCOPY of DCDB files started ' time() date()
  54.  'XCOPY ' root || 'DCDB\APPS\*.* ' destpath||'\DCDB\APPS\*.*' XC_OPT
  55.  'XCOPY ' root || 'DCDB\DATA\*.* ' destpath||'\DCDB\DATA\*.*' XC_OPT
  56.  'XCOPY ' root || 'DCDB\DEVICES\*.* ' destpath||'\DCDB\DEVICES\*.*' XC_OPT
  57.  'XCOPY ' root || 'DCDB\IMAGES\*.DEF ' destpath||'\DCDB\IMAGES\*.DEF' XC_OPT
  58.  'XCOPY ' root || 'DCDB\FILES\*.* ' destpath||'\DCDB\FILES\*.*' XC_OPT
  59.  'XCOPY ' root || 'DCDB\LISTS\*.* ' destpath||'\DCDB\LISTS\*.*' XC_OPT
  60.  'XCOPY ' root || 'DCDB\PRINTERS\*.* ' destpath||'\DCDB\PRINTERS\*.*' XC_OPT
  61.  'XCOPY ' root || 'DCDB\USERS\*.* ' destpath||'\DCDB\USERS\*.*' XC_OPT
  62.  'XCOPY ' root || 'LOGS\*.* ' destpath||'\LOGS\*.*' XC_OPT
  63. end
  64. else do
  65.  rc = SysRmDir(root || 'DCDB')
  66. end
  67.  
  68. /* RIPL services installed? */
  69. rc = SysMkDir(root || 'RPL')
  70. if rc = 0 then do
  71.  rc = SysRmDir(root || 'RPL')
  72.  Call "LINEOUT" logfile
  73.  exit 0
  74.  end
  75. else do
  76.  Call "LINEOUT" logfile,  'XCOPY of RIPL files started ' time() date()
  77.  'XCOPY ' root || 'RPLUSER\*.* ' destpath||'\RPLUSER\*.*' XC_OPT
  78.  'XCOPY ' root || 'RPL\FITS\*.* ' destpath||'\RPL\FITS\*.*' XC_OPT
  79.  'XCOPY ' root || 'RPL\IBMCOM\*.* ' destpath||'\RPL\IBMCOM\*.*' XC_OPT
  80.  'XCOPY ' root || 'RPL\IBMLAN\*.* ' destpath||'\RPL\IBMLAN\*.*' XC_OPT
  81.  'XCOPY ' root || 'RPL\MACHINES\*.* ' destpath||'\RPL\MACHINES\*.*' XC_OPT
  82. end
  83.  
  84. :figseg fit=16.
  85. /* close response files */
  86. Call "LINEOUT" logfile
  87.  
  88. exit 0
  89.  
  90. /**************************************************************************/
  91. /* Display options                                                        */
  92. /**************************************************************************/
  93. DSP_HELP:
  94. say
  95. say ' BXC4AS copytype landrive destpath logfile'
  96. say ' where'
  97. say ' copytype  ALL files or file CHANGES'
  98. say ' landrive  The IBMLAN drive like for example C:'
  99. say ' destpath  The destination path for XCOPY like X:\BACKUP\TODAY'
  100. say ' logfile   The logfile path and file name'
  101. return
  102.  
  103.