home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / autobk2.zip / FullBkup.CMD < prev    next >
OS/2 REXX Batch file  |  1995-12-11  |  3KB  |  89 lines

  1. /***************************************************/
  2. /* REXX Procedure to perform full backups          */
  3. /***************************************************/
  4. '@ECHO OFF'
  5. logswitch = 1             /* Maintain the log file */
  6. av = 'YES'                /* AutoVerify = YES | NO */
  7.  
  8. /***************************************************/
  9. /* Extract the date and in mm/dd/yy format         */
  10. /***************************************************/
  11. rundate = Date('U')
  12.  
  13. /***************************************************/
  14. /* Initialize REXXUtil environment (if not present)*/
  15. /***************************************************/
  16. rxload = RxFuncQuery('SysLoadFuncs')
  17. If rxload Then
  18.    Do
  19.       Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  20.       Call sysloadfuncs
  21.    End
  22.  
  23. /***************************************************/
  24. /*  Locate the active BackMaster directory         */
  25. /***************************************************/
  26. bmname = SysSearchPath('PATH', 'BACKMAST.EXE')
  27. bmdrive = Filespec('D', bmname)
  28. bmpath = Filespec('P', bmname)
  29. bmpath = bmdrive||bmpath
  30.  
  31. /***************************************************/
  32. /* Extract the drives available on the system      */
  33. /***************************************************/
  34. drives = SysDriveMap('C:', 'LOCAL')
  35.  
  36. /***************************************************/
  37. /* Load number of drives into table root           */
  38. /***************************************************/
  39. drive.0 = Words(drives)
  40.  
  41. /***************************************************/
  42. /* Load the table with the available drive letters */
  43. /***************************************************/
  44. Do x=1 To drive.0 By 1
  45.    drive.x = Word(drives, x)
  46. End
  47.  
  48. /***************************************************/
  49. /* Build a list of drive partitions to back up.    */
  50. /***************************************************/
  51. drive_string = ''
  52. Do x=1 To drive.0 By 1
  53.    filesys = FileType(drive.x)
  54.    If filesys = 'HPFS' | filesys = 'FAT' Then
  55.       drive_string = drive_string || ,
  56.                      Strip(drive.x, 'T', ':') || ,
  57.                      ','
  58. End
  59. drive_string = Strip(drive_string, 'T', ',')
  60.  
  61. /***************************************************/
  62. /* If we're maintaining the log file, do so now.   */
  63. /***************************************************/
  64. If logswitch Then
  65.    Do
  66.       rc = SysFileTree(bmpath || 'BACKMAST.OLD', 'file', 'F')
  67.       If file.0 <> 0 Then
  68.          Call SysFileDelete bmpath || 'BACKMAST.OLD'
  69.       rc = SysFileTree(bmpath || 'BACKMAST.LOG', 'file', 'F')
  70.       If file.0 <> 0 Then
  71.          'REN' bmpath || 'BACKMAST.LOG' bmpath || 'BACKMAST.OLD'
  72.    End
  73.  
  74.  
  75. /***************************************************/
  76. /* Perform a full backup of all FAT or HPFS drives.*/
  77. /***************************************************/
  78. 'START /MIN BACKMAST /D:' || ,
  79.                      drive_string ,
  80.                      '/BF:"FULL:' rundate || ,
  81.                      '" /AV:' || av
  82.  
  83. /***************************************************/
  84. /* All done, end processing.                       */
  85. /***************************************************/
  86. If rxload Then
  87.    Call SysDropFuncs  /* Drop only if we loaded */
  88. Exit
  89.