IBM Works for OS/2 | 1995-12-08 | 174KB | 1,829 lines
IBM Works OS/2
Automated Scripts for BackMaster
Copyright (C) Footprint Software Inc. 1993-1994
LASERJET
HP LaserJet IIID
HPLaserJ
I originally wrote these REXX programs for my own personal use with BackMaster 2.0 on my home OS/2 Warp system
, but from what I'd seen in the Compuserve OS2BVEN forum I thought others would find them useful too. If not as is, they can be easily modified to suit your needs. I am releasing these seven programs to the public domain; I only ask that if you make modifications that you feel will be useful to the public at large to please send me a copy so that I might implement them in my own personal copy. Since this is public domain, I also ask that any external function calls utilized by these programs also be freely available to the general public. It does no good to release some programs in the public domain if the user has to pay for a particular component in order for it to run
(other than MSR's BackMaster 2.0, of course!)
Three of the programs in this archive require the IBM EWS Visual REXX extensions. This is freely available from many sources, including the IBM PC BBS, and the OS2USER forum on Compuserve. It is freeware; IBM retains all rights to the program, but it may be distributed and used free of charge. The file name is most typically VREXX2.ZIP.
This archive contains ten files:
ReadMe.TXT This document in plain ASCII text format
ReadMe.LWP This document you are reading now.
BMMenu.CMD A program allowing you to select between a full or an incremental backup of all of your partitions, or to quick erase a number of tapes.
BMLog.CMD Display the BackMaster Log file.
FullBkup.CMD Perform a full backup of all of your partitions.
IncrBkup.CMD Perform an incremental backup of all of your partitions.
ZapTapes.CMD Perform a Quick Erase of a set number of cartridges
TpFormat.CMD Format a set number of cartridges.
FileType.CMD External function to determine a partition file system.
Whats.new History of changes made to the programs here.
BMMenu.CMD
This program allows you to select which type of backup you want to run. Currently, it only allows you a choice of a full backup of all of your partitions, an incremental backup of all of your partitions, or you can quick erase
(or format)
a number of cartridges in preparation for running a backup. You can easily modify the code if you would like to add more options. If you know REXX at all
(or you're willing to learn)
the changes required should be obvious. Experiment!
(just make sure you have a copy of the original in case you make a mistake!).
This program uses IBM's Visual REXX extensions and will not run without them.
BMLog.CMD
This quick and dirty little program will display the current BackMaster Log file. As written, it assumes the log file name is BACKMAST.LOG, and that the BackMaster directory is in your PATH. It utilizes the OS/2 Enhanced Editor
(EPM.EXE),
but you can easily modify the program to use the OS/2 System Editor
(E.EXE)
, or any other text display program you'd like.
FullBkup.CMD
This program will perform an automated full backup of every logical FAT and HPFS drive on your system.
In addition, this program will maintain two copies of your BACKMAST.LOG file
(if you have one).
Prior to performing it's first backup, it will delete the existing BACKMAST.OLD file
(if any)
and rename the current BACKMAST.LOG to BACKMAST.OLD. This mechanism should prevent one single BACKMAST.LOG from growing too large. This program will create the backup with a name of:
FULL:
mm/dd/yy
Where
mm/dd/yy
is the date on which the backup was performed.
This program will use the FileType() external function call to determine the logical drive type.
IncrBkup.CMD
This program will perform an automated incremental backup of every logical FAT and HPFS drive on your system. Each incremental backup will be created with a name of:
INCR:
mm/dd/yy
Where:
mm/dd/yy
is the date on which the backup was performed.
The name differs from the Full Backup in order to allow the user to easily differentiate which type of backup is on the tape if the user should scan the tape directory. This program will use the FileType() external function in order to determine the logical drive type.
ZapTapes.CMD
This program will allow you to erase a number of cartridges prior to performing a full or an incremental backup. If you select this program from the BMMenu.CMD menu, BMMenu will restart and allow you to decide which backup you want to perform
(it is assumed you wanted to Quick Erase the tapes prior to running the backup)
. The program will calculate how much space is actually used on your system, and give a rough estimate of how many tapes you'll need. If you are using tapes that can hold more than 250M of data, edit the program and change the value for the "capacity" variable at the beginning of the code. Usually you'll need more than the default, but you are allowed to override it in any case. This program will use the FileType() external function so as to not include CD-ROM or VDU drives in it's space calculations. It also requires IBM's Visual REXX extensions in order to run.
TpFormat.CMD
This program was essentially cloned from ZapTapes.CMD
(above)
so everything documented for ZapTapes.CMD also applies to this program. The difference is that this program will format the tape, not just perform a Quick Erase. Use this program if you are getting errors while backing up
(typically Error 52)
. Formatting a tape will also mark those blocks identified as being "bad" so that BackMaster won't attempt to use them. Be aware that formatting a standard DC2120 cartridge can take up to two hours unless you are using a high-speed tape controller. Higher capacity tapes will take even longer.
FileType.CMD
I inquired from several places on how I could determine through a REXX program what type of file system is being used by a particular partition. I received lots of useful suggestions until I hit upon what I feel is the best possible one. I have a product installed called "Performance 2.1 Plus" from Clear And Simple, Inc. This is a performance and tuning tool kit written entirely in OS/2 REXX/2. One of the tools, SeeSys.CMD, was correctly identifying each partition on my system. I decided to look at the source to see how it was doing this. What I found was a very simple technique which I've used to write FileType.CMD. Please note that while I duplicated the technique, the code used is entirely different! I did not plagiarize the code! "Performance 2.1 Plus" is a terrific product for two reasons:
1) It provides lots of useful information for tuning an OS/2 2.x system, and
2) It provides some terrific examples of REXX coding for those of you interested in furthering your knowledge of this wonderfully flexible language.
Enough of the plug. FileType.CMD is an external function that must be invoked from within other REXX programs in order to perform any useful function.
Example:
FileType
drivespec
Where:
drivespec
is the logical identifier of the drive you are interested in. It must be an alphabetic character followed by a colon
(or a variable representing this information)
. If the drivespec is incorrectly coded, or represents a drive that does not exist on your system, then
"type"
will contain the literal
"ERROR"
. If the specified drive is not ready or unmounted, then
"type"
will contain the literal
"NOT READY"
, otherwise it will contain
"FAT," "HPFS"
"CD-ROM"
(no quotes)
. The newest revision will also return
"VDU"
for a DCF/2 container volume.
I hope you find these programs useful. Information on the products and vendors named here are:
BackMaster 2.0
MSR Development
P.O. Box 632070
Nacogdoches, TX 75963
409-564-1862 - Voice
409-560-5868 - FAX
409-560-5970 - BBS
Performance 2.1 Plus
Clear & Simple, Inc.
P.O. Box 130
W. Simsbury, CT 06092
203-658-1204 - Voice
DCF/2
Proportional Software Corporation
1717 Linden Lake Road
Fort Collins, CO 80524
303-484-2665 - Voice
303-484-2670 - FAX
OS/2 Warp 3.0
The IBM Corporation
919-517-0001 - BBS
800-342-6672 - Voice Sales
The author may be contacted at:
Compuserve: 72267,1372
Internet: 72267.1372@compuserve.com
-- or --
jcruz@ibm.net
History
11/30/94
Since uploading the original set of programs, I've made the following updates based on input from other users, and observations I've made on my own:
1) FileType.CMD
has been modified to not include drives A: or B: when validating file system types. Currently, A: and B: can only be FAT, and scanning these drives causes an unnecessary pause in processing.
2) FullBkup.CMD
has been modified to re-attempt a backup if BackMaster should end with a return code other than zero (0). This comes from information learned on-line from MSR technical support.
3) IncrBkup.CMD
has also been modified to re-attempt a backup if BackMaster should end with a non-zero return code. However, a bug in the current shipping version of BackMaster (1.1) would have already reset the archive bits in the files so that a subsequent rerun would skip these files. I am attempting to bypass that problem by reading the BackMaster LOG file and resetting the archive bits of those files prior to rerunning the backup. Kludgy, but it'll do till a fix comes along.
4) FullBkup.CMD
will now maintain the BackMaster log file. The current log file will be renamed to BACKMAST.OLD. The previous log file will be deleted. Using this method, the log file will contain information on only the full backup and all subsequent incrementals. The previous set can be viewed by browsing BACKMAST.OLD, the current can be viewed by browsing BACKMAST.LOG. This should prevent the log file from growing too large on the hard disk.
12/20/94
1) IncrBkup.CMD
has been changed
(again)
. It will actually perform a differential backup (which does not reset the archive bit). If the backup ends successfully, then
(and only then)
the REXX program itself will reset the archive bits. The method I employed on 11/30 never worked properly
(Sigh).
01/08/95
1) IncrBkup.CMD
(you guessed it)
changed again. It will now attempt only three retries if it should fail. I've already had the thing running all night and I think that three attempts is sufficient. In reality, if the first retry doesn't work, it's doubtful the second and third will, but I wanted to give it a chance.
2) FullBkup.CMD
Same changes as above. Will only make three retry attempts if the backup should fail.
01/30/95
1) FileType.CMD
Modified to detect DCF/2 Virtual Disk Units (VDU). The change was suggested by Jim Showalter (CIS 76266,1141) when he discovered that the current versions of BackMaster and DCF/2 were incompatible. You can still use BackMaster to back up the container file, you just can't back up the individual files within. Jim also pointed out to me that the previous version of FileType.CMD would cause an error pop-up window to appear if the CD-ROM drive was not ready or mounted, which would halt the backup process. Not very convenient for an unattended backup. That has been corrected
(I Hope)
in this version. Thanks, Jim!
2) IncrBkup.CMD
Modified to back up FAT and HPFS volumes only. It will skip CD-ROM and VDU partitions. Changed the backup name to "INCR
drivespec: mm/dd/yy
3) FullBkup.CMD
Modified to back up FAT and HPFS volumes only. It will skip CD-ROM and VDU partitions. Changed the backup name to "FULL
drivespec: mm/dd/yy
4) ZapTapes.CMD
Modified to skip VDU's when calculating number of tapes required for a full backup.
02/07/95
1) FileType.CMD
Modified to return "NOT READY" instead of "ERROR" if the specified drive is not ready, or not mounted. Automatically return "FAT" if A: or B: is specified. Also cleaned up the code to make it more structured, and corrected the invocation of the SysMkDir and SysRmDir function calls.
2) FullBkup.CMD
Added a variable at the beginning of the program to make it easier to control "AutoVerify" processing. The latest beta seems to have resolved the problems in "AutoVerify" processing, so I'm putting it back in.
3) IncrBkup.CMD
Same changes as above.
4) ZapTapes.CMD
Added a variable at the beginning of the program to make it easier to change the default capacity of each cartridge, since the new version of BackMaster will support cartridges that can hold more than 250M. The default is currently 250M.
02/14/95
1) BMMenu.CMD
Added an option to format tapes.
2) TpFormat.CMD
New program, based on ZapTapes.CMD, but invokes BackMaster to format tapes instead of performing a Quick Erase.
03/04/95
1) FullBkup.CMD
Modified the program to optionally run a verify only if the backup was successful. I had a situation arise where the backup was successful, but the "AutoVerify" encountered an error. This caused the REXX program
(though the invalid return code)
to act as though the backup had failed, and it reattempted the backup. Since you can't have two volumes with the same name on the same tape, the procedure ended in error. Now
(by setting the variable "av" at the beginning of the program)
the verify step is run by the REXX program only if the backup is successful.
2) IncrBkup.CMD
Same changes as above. The AutoVerify will occur prior to resetting the archive bits.
04/20/95
1) BMLog.CMD
Added a new utility to the suite. BMLog.CMD will display the current BackMaster log file using the OS/2 Enhanced Editor. You can easily modify the program to invoke the OS/2 System Editor if that is your preference
(Change
EPM.EXE
E.EXE
06/27/95
1) FullBkup.CMD
Modified this program to allow it to run an unattended full backup of each partition. If this feature is activated
(change the "prompt" variable at the beginning of the program from
"YES"
the program will backup every partition without first prompting for permission. This probably best used if you have a higher capacity tape drive, such as a CMS Jumbo 1000. If you are using standard QIC-80 tapes
(250M compressed capacity)
you may want to leave the default setting alone. Odds are you will be prompted by BackMaster itself for new cartridges as the current one gets filled.
07/28/95
1) BMMenu.CMD
Modified to add a selection for displaying the BackMaster log file
(call BMLog.CMD)
. After displaying the log, the user will be reprompted for another action.
08/03/95
1) IncrBkup.CMD
Modified so as to not to attempt to launch BackMaster if the only files with their archive bits set on are "EA DATA. SF", "WP ROOT. SF" or "SWAPPER.DAT". In the past, if this condition ever arose, BackMaster stopped in the "Verify" pass until the user pressed the "OK" button
(not exactly desirable for an unattended backup).
09/28/95
1) FullBkup.CMD
Modified to work with the changes in BackMaster 2.0. This version does not recognize drive letters followed by a colon (:) for the /D: parameter. Removing the colon doesn't seem to affect operations with previous versions of BackMaster.
2) IncrBkup.CMD
Same changes as above.
3) ReadMe.LWP
The original ASCII manual converted to IBM Works Word Processor format. The original version is retained for those users who did not install IBM Works from the Bonus Pack.
12/08/95
1) FullBkup.CMD
New version! BackMaster 2.0 now eliminates many of the reasons for the existence of these scripts. That being the case, this script was pared down to the minimum. It still performs the BACKMAST.LOG file maintenance, but instead of invoking BackMaster once each
(twice if av=YES)
for every partition, it will now exploit BackMaster's native capability of backing up multiple partitions in a single pass. This script will back up ONLY local hard drives, not CD-ROMs or network drives.
2) IncrBkup.CMD
New version! BackMaster 2.0 now eliminates many of the reasons for the existence of these scripts. That being the case, this script was pared down to the minimum. Instead of invoking BackMaster once each
(twice if av=YES)
for every partition, it will now exploit BackMaster's native capability of backing up multiple partitions in a single pass. This script will back up ONLY local hard drives, not CD-ROMs or network drives. It will check to insure there are files that require backing up before adding the drive letter to the drive list.
3) ReadMe.LWP
This text file has been rewritten to remove references to BackMaster 1.1 and OS/2 2.x. These new scripts have never been tested under anything but Warp, and the new facilities used did not exist in BackMaster 1.1.
As always, you are free to modify these programs to more closely fit your requirements. I wrote them to suit my specific needs and am releasing them to the public domain in the hopes that others will also find them useful.