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

  1. /****************************************************************************/
  2. /* REXX LAN Server 3.0 Entry XCOPY Backup procedure. BXC4ES.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. 'backacc'
  37. Call "LINEOUT" logfile,  'XCOPY of Access Control Profiles started '
  38. root = landrive || '\IBMLAN\'
  39. 'XCOPY ' root || 'ACCOUNTS\*.BKP ' destpath ||'\ACCOUNTS\*.BKP /S'
  40.  
  41. /* Is this a Domain Controller or Backup Domain Controller? */
  42. rc = SysMkDir(root || 'DCDB')
  43. if rc <> 0 then do
  44.  Call "LINEOUT" logfile,  'XCOPY of DCDB files started ' time() date()
  45.  'XCOPY ' root || 'DCDB\APPS\*.* ' destpath||'\DCDB\APPS\*.*' XC_OPT
  46.  'XCOPY ' root || 'DCDB\DATA\*.* ' destpath||'\DCDB\DATA\*.*' XC_OPT
  47.  'XCOPY ' root || 'DCDB\DEVICES\*.* ' destpath||'\DCDB\DEVICES\*.*' XC_OPT
  48.  'XCOPY ' root || 'DCDB\IMAGES\*.DEF ' destpath||'\DCDB\IMAGES\*.DEF' XC_OPT
  49.  'XCOPY ' root || 'DCDB\FILES\*.* ' destpath||'\DCDB\FILES\*.*' XC_OPT
  50.  'XCOPY ' root || 'DCDB\LISTS\*.* ' destpath||'\DCDB\LISTS\*.*' XC_OPT
  51.  'XCOPY ' root || 'DCDB\PRINTERS\*.* ' destpath||'\DCDB\PRINTERS\*.*' XC_OPT
  52.  'XCOPY ' root || 'DCDB\USERS\*.* ' destpath||'\DCDB\USERS\*.*' XC_OPT
  53.  'XCOPY ' root || 'LOGS\*.* ' destpath||'\LOGS\*.*' XC_OPT
  54. end
  55. else do
  56.  rc = SysRmDir(root || 'DCDB')
  57. end
  58.  
  59. /* RIPL services installed? */
  60. rc = SysMkDir(root || 'RPL')
  61. if rc = 0 then do
  62.  rc = SysRmDir(root || 'RPL')
  63.  Call "LINEOUT" logfile
  64.  exit 0
  65.  end
  66. else do
  67.  Call "LINEOUT" logfile,  'XCOPY of RIPL files started ' time() date()
  68.  'XCOPY ' root || 'RPLUSER\*.* ' destpath||'\RPLUSER\*.*' XC_OPT
  69.  'XCOPY ' root || 'RPL\FITS\*.* ' destpath||'\RPL\FITS\*.*' XC_OPT
  70.  'XCOPY ' root || 'RPL\IBMCOM\*.* ' destpath||'\RPL\IBMCOM\*.*' XC_OPT
  71.  'XCOPY ' root || 'RPL\IBMLAN\*.* ' destpath||'\RPL\IBMLAN\*.*' XC_OPT
  72.  'XCOPY ' root || 'RPL\MACHINES\*.* ' destpath||'\RPL\MACHINES\*.*' XC_OPT
  73. end
  74.  
  75. /* close response files */
  76. Call "LINEOUT" logfile
  77.  
  78. exit 0
  79.  
  80. /**************************************************************************/
  81. /* Display options                                                        */
  82. /**************************************************************************/
  83. DSP_HELP:
  84. say
  85. say ' BXC4ES copytype landrive destpath logfile'
  86. say ' where'
  87. say ' copytype  ALL files or file CHANGES'
  88. say ' landrive  The IBMLAN drive like for example C:'
  89. say ' destpath  The destination path for XCOPY like X:\BACKUP\TODAY'
  90. say ' logfile   The logfile path and file name'
  91. return
  92.  
  93.