home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / bakitup1.zip / bakitup.txt < prev    next >
Text File  |  1993-05-31  |  5KB  |  115 lines

  1. BAKITUP.CMD
  2.  
  3. This is a FREE program.  You may use it or modify it to
  4. you heart's content.  Just think nice thoughts about me if
  5. you like it, and think no thoughts about me if you don't.
  6. Needless to say, there are no warranties of any sort, and you use
  7. it at YOUR OWN RISK.
  8.  
  9. Maurice Fox
  10.  
  11. This is a little REXX file to automate use of the OS/2
  12. BACKUP program.  It can be used directly, or you could use
  13. it as a template for other purposes.  I will admit up front that
  14. I don't have a snazzy tape backup system, so I just use the backup
  15. program that comes with OS/2, just as I used its DOS predecessor
  16. for years.  The motivation for this routine is the following:
  17.  
  18. 1.  Back up the files that I want to have backed up
  19. 2.  Don't back up other files
  20. 3.  Keep a log on a separate diskette, listing only the files
  21.     backed up, without cluttering it with empty subdirectory
  22.     names as BACKUP's /S option does
  23. 4.  Make it convenient to start over with a new set of backup
  24.     diskettes, or to continue with one previously started
  25.  
  26. It works by searching the specified subdirectories of the 
  27. specified disks for the files desired and running BACKUP only 
  28. it finds matching files.  When it runs, it first prompts for
  29. you to put the log diskette in its drive, then asks whether you
  30. want a new set or not.  If you reply starts with the letter N
  31. (or n) (short for NEW) the parameters for BACKUP are set to
  32. back up all files, and the BACKUP.LOG file is deleted from the
  33. log diskette.  Otherwise, it is set to back up only modified
  34. files, and the BACKUP.LOG file is left intact.  As shipped, it
  35. works for me, but you will want to customize it to your own setup.
  36. You do that with any convenient text editor, as explained below.
  37. If you have a lot of subdirectories, the initial start of a new
  38. set if backup diskettes will be a bit tedious, but subsequent
  39. runs, adding to the backup diskettes only the modified files,
  40. will be a breeze.
  41.  
  42. INSTALLATION
  43.  
  44. Copy the file BAKITUP.CMD to a convenient directory.  The easiest
  45. way is to use one that is on your PATH.
  46.  
  47. USE
  48.  
  49. (You need to customize it first, as described below.)
  50.  
  51. From an OS/2 command prompt, either full screen or windowed,
  52. enter the command
  53.  
  54.    BAKITUP
  55.  
  56. and follow the prompts.  The first prompt is to put the log
  57. diskette in a diskette drive.  The second prompt asks whether
  58. you want to start a new set or not.  A "new set" is what you do
  59. the first time you use BAKITUP, or when you have accumulated so
  60. many backup diskettes you want to start over again.  The remaining
  61. prompts all come from the system BACKUP command, and just ask you
  62. to stick diskettes in the drive and hit Enter.  If you are as
  63. error-prone as I am, you may wish to replace the system message
  64. file with one that gives a better warning that a new diskette
  65. is needed.  That file and instructions for installing it
  66. should accompany this file.
  67.  
  68. CUSTOMIZING BAKITUP.CMD FOR YOUR OWN USE
  69.  
  70. The things you can change are the following:
  71. 1.  The directories to be searched
  72. 2.  The file specifications to be searched for
  73. 3.  The place to put the backup files
  74. 4.  The place to put the log file
  75. 5.  The command to be executed
  76.  
  77. This is sort of in order of decreasing likelihood of your 
  78. wanting to change something.
  79.  
  80. Everything is governed by variables coded into the file, so
  81. to change anything, you need a text editor that saves plain
  82. ASCII files.  The system editor that comes with OS/2 will work
  83. just fine.  If you use a word processor, be sure to have it save
  84. the file in ASCII format.
  85.  
  86. TO CHANGE THE DIRECTORIES AND FILE SPECS
  87.  
  88. Find line 122 of the program, where you will find a set of
  89. pairs of variables, starting with the pairs paths.0 and files.0.
  90. There is a sequence of them, currently ten pairs.  Inspect the
  91. values, and you can see how it works.  Each value of paths is
  92. the starting point for a search tree.  The program inspects 
  93. that directory and each of its subdirectories for files that
  94. match each of the specifications contained in the corresponding
  95. files variable.  (As currently arranged, it does not inspect hidden
  96. directories, but you could change that by modifying the dattribs
  97. variable, which is set on line 52.)
  98.  
  99. When you add or delete files/paths pairs, you need to change the
  100. value of the variable limit, which is currently at line 152.  To
  101. keep things working sensibly, be sure that you have paths and
  102. files paired and numbered consecutively, no gaps.
  103.  
  104. TO CHANGE THE DESTINATION OF THE BACKUP FILES AND THE LOG FILE
  105.  
  106. Change the value of the two variables backupdisk
  107. and logdisk, which are set on lines 8 and 9, respectively. 
  108. (Clever names, hey?) BACKUP insists that they be different disks.
  109. This arrangement puts them both on diskettes, but you could log to
  110. a hard disk if you wanted to.
  111.  
  112. TO CHANGE THE COMMAND TO BE EXECUTED
  113.  
  114. Change the value of extcmd, located at line 14 of the file.
  115.