;;07-18-85 BBACK.DOC v.6.22 11/09/85 Eric Gans French Dep't UCLA Los Angeles, CA 90024 Version 6.22 Versions 6.21 and 6.22 correct bugs in the catalog rewriting rou- tine in v6.2. No other bugs have been found recently... Version 6.2 Allows option of creating/using catalog; changed syntax to use switches. Fixed a couple of (smaller!) bugs in date, error, number-reading routines. Version 6.1 Fixed a number of serious bugs in v6.0 in reading the date, rewriting the catalog file to disk, checking for duplicate backups, etc. Added output of the catalog file-name & changed a few messages. BBACK, like BBCAT, now makes a BAK file if the catalog is changed. CAL v1.4 no longer includes specific Kaypro- 10 graphics commands. Also updated BBDEF (v1.2). Version 6.0 Enters backups/dates in catalog. Eliminated LBR dating option because of CRC library directory errors. [previous version information has been eliminated for greater readability] <<< NB >>> The COM files in this library are named with version numbers to avoid confusion with other versions. These numbers should be removed from the names before use; BBDEF will work only with files named BBACK and BBCAT (not BBACK62 etc.), and CAL rewrites itself to disk as CAL.COM and will not work as CAL14.COM. *** The backup program BBACK.COM was inspired by an inaccuracy in Johnson-Laird's "Programmer's CP/M Handbook," p. 26: "the File Changed bit (bit 7 of byte 11) is always set to 0 when you close a file to which you have been writing." Unfortunately, in CP/M 2.2 it isn't. Thus to use BBACK correctly, you must first modify your BDOS to reset this bit whenever a file is closed. Check the addresses in the included patch ARCH.AZM, assemble it with a Z80 assembler, and load the HEX file with SID, DDT, MLOAD etc. along with the file (most often called SYSGEN) that contains a memory image of the BDOS. (On the Kaypro-10 this file is called PUTSYS.COM.) After patching, execute the file and its contents will be written to the system tracks of your disk. If you have CP/M v.3, you can skip this procedure. Commands Format 1: bback [d1:]fn.ft [>d2] [/nu] (*? ok in fn.ft) d1 is the drive to back up (default: current drive) d2 is the drive on which the backup will be made. The default is set to C: (floppy drive on the Kaypro-10); it can be reset with BBDEF. fn.ft can (and usually does) contain wildcards Switches: N = Don't catalog backups (for users who want to use BBACK without its cataloguing feature, or for files you don't want included in your catalog). U (formerly "#") = Search all user areas. If this option is used, the files will be copied to their repsective user areas on the backup disk; thus if you have two copies of the same file in different user areas they will remain separate. Examples: bback c:*.zap >d /n | bback urk.* | bback a:*.* >c bback z*.* /u Format 2: bback [d1][>][d2] [/nu] (the '>' is needed if EITHER d1 or d2 is present.) You will be prompted for filetypes to be backed up. The format for this entry is: >>ft1;ft2;ft3... (max 127 chars) Wildcards are permitted; enter a space for blank filetype. Example: >>zap; ;s*;??z will back up files: *.zap | *. (blank file-type) | *.s?? | *.??z If you used the /u switch in the command line, they will be searched for in all user areas of the selected drive. After copying the file, BBACK will set the archive bit of the original (not the backup) file. The next time BBACK is run, it will not copy the file if the archive bit is set. If you patch your BDOS with ARCH.AZM, CP/M will reset the archive bit whenever the file is closed (which presumes it has been written to). Thus BBACK permits you to back up sets of files without having to recall which ones have been written to since the last backup. In conjunction with BBCAT, it provides an automatic file-dating and cataloguing system that requires you only to keep the current date in CAL.COM. Catalog entry This feature requires no extra input from the user. Unless you use the "N" switch, BBACK will look for a catalog file of form BB*.CAT on the user area from which it is called, and will prompt you to create BB0.CAT if it fails to find one. (This file can be renamed as you please within the BB*.CAT filespec.) The catalog requires disks to contain the traditional -*.nnn (0 < nnn < 256) number file, but if you haven't numbered your backup disk BBACK will number it 255 (if you use two disks, the second will be numbered 254, etc.). The format of the number file is -+RENUM+.nnn; the point of the name is to remind you to renumber the disk. BBCAT can do this and will also renumber all affected catalog entries. Catalog entries include the date and the disk number; if you back up a file on the same disk the catalog entry will be updated (not duplicated). When BBACK copies a file it outputs a list of previous backups; a backup on the same disk is indicated by "=". Since BBACK only eliminates old backups by overwriting, you should keep your catalog current by not backing up the same file in different user areas of a diskette. I suggest you create separate catalogs for groups of files you back up on different sets of floppies. Automatic cataloguing makes it much easier to keep track of your backups and to eliminate duplicates. Aside from the dating feature, BBCAT allows greater user control over file entry (including renumbering of disks and selective entry/deletion of files) than other catalog programs. Please see BBCAT.DOC for further details. Dating feature BBACK expects to find CAL.COM in user area A0, and copies the date (presumably current) stored in that file. In order to date your files (both the original and the backup copy), two formats are used: - For MBasic files (including ASCII .BAS files) the first line must begin: 0 REM xxxxxxxx I usually put: 0 REM xxxxxxxx <-- last modified The date will be entered in the place of the 8 x's. - For text files, the first two bytes of the file must be ;; or WordStar/NewWord and will not show up in printouts or line counts. You must put a hard after the date.) The date will occupy the next eight bytes. (See this file itself for an example.) You should enter eight spaces after the ;; or .. (the easiest thing is to enter: ;;xxxxxxxx); otherwise the date will replace whatever is in the eight bytes following the ;;. If CAL.COM is not present, BBACK will enter the date 01-01-80. LBR file dating has been eliminated, since NULU and other library utilities interpret changes in the directory as CRC errors. You should still include a date file in all libraries. CAL.COM makes a daily -mm-dd-y.y## file for this purpose. Customizing Default Settings BBDEF.COM v1.2 The original default settings are found in the first sector of BBACK and BBCAT. You can use BBDEF to change them; you will be prompted for entries. (Warning: DO NOT use BBDEF 1.0 with BBACK 5.1+; BBDEF 1.1 will work with BBACK 6.2, but will not modify BBCAT.) BBCAT and BBACK must be renamed as such (not BBCAT12 etc) for BBDEF to work. ADDR Decription Setting 102H = Highest drive (a=1) 3 (=C:) 103H = Default backup drive 3 (=C:) [104H = MAXFL 16 (for a 60K system)] 102H in BBCAT = Def back dr 3 (C:) MAXFL is no longer used in v6.1+, as the catalog must be written into memory as well. Figuring 1000 files in the catalog (=16 K), plus 8.5 K for BBACK + the operating system, you will have room for about 1300 new files in a typical 60 K system (12 bytes per file for BBACK's file table, plus 16 more for the new catalog entry). To be on the safe side, BBACK now gives you an error message if you enter more than 1024 files at one time: not a very severe constraint! Notes - BBACK uses the entire free memory area as its file buffer. The catalog file is written into memory above the file buffer; catalog entries take 16 bytes per file. Even if you have 2000 entries in your catalog, there is still room for something like 800 new entries on 60 K systems. - The filetype buffer is 127 bytes long (30+ filetypes). - To abort the program while copying, type any key. It will terminate when the current file has been backed up. - If the backup diskette (or its directory) is full, BBACK will prompt you to insert another diskette to continue its operation. - The DMA is kept at 80h. This means a lot of disk activity if you use BBACK to copy files from one side of a hard disk to the other; but that's not the normal way to make backup files, is it? RDATE.COM v1.1 This program reads the date from files backed up with BBACK. Format: rdate [d:]fn.ft Wildcards are accepted. If rdate [d:] is entered alone, all files except COM files are included. The file table holds a maximum of 69 files (one screen full in 3 columns). This utility allows you to examine the dates of your files without having to access them individually. Although BBACK v6.0+ no longer enters the date in LBR files, RDATE will still read the date from datefiles that use CAL format (-mm-dd-y.y##). CAL.COM v1.4 This little calendar program is self-explanatory. You enter "N(ext)" once a day to keep the date current, "C" to change the date to something other than the next day, and "S" if the date is unchanged. If you change the date, CAL will create a zero-length file -mm-dd-y.y## (and erase any previous such file) for the purpose of dating libraries, etc. For use with BBACK, CAL must be kept in A0. The current version of CAL will work for the 20th century only; an update will be issued in 1999 (if I live that long). The Kaypro-10 graphics included in previous versions have been removed from v1.4 out of sympathy for non-Kaypro users.