Nash - Scientific Computing with PCs (523165), страница 15
Текст из файла (страница 15)
Nevertheless, it is a easy task to erase all files of type .BAK for example. We even have autility program that removes several different types of temporary files from all directories on a disk atonce.Programs may make backup copies of files at periodic intervals. WordPerfect does this. We find itannoying to be asked to wait while the program saves information, but the idea is useful in the generaloffice environment where file-saving discipline may be slack.The backup described so far is for individual files and represents localized backup against loss of datafor a specific purpose.
If we wish to answer the threat of loss posed by catastrophic failure of a fixed disk,then we need a more extensive mechanism for saving both the files and their organization, that is, thedirectory structure. We now turn to consideration of "full" backup.The goal of a full backup is to mirror the contents and organization of the file system on a machine bycopying all the files and directories onto backup media (disks or tapes). We strongly urge users toevaluate the costs and benefits of backup strategies before undertaking any serious exercise in backingup a system. Back-up takes time and effort, as well as resources in the form of equipment and media.However, we quickly improved our own back-up discipline when a neighbor’s house burned down inmid-afternoon on a public holiday, while the occupants were home, and with such speed that the familydog perished.File backup is amenable to risk/benefit analysis (Nash J C and Nash M M, 1992).
The costs of data losswill depend on the particular file collection under consideration. We can ascribe time-costs to the tasksof recovering lost files. Moreover, following an approach like that outlined in Section 5.2, files can bepartitioned into several categories so that costs can be ascribed to losses of each type. For example, wemay have:•Files we care very little if we lose (temp, old drafts of papers, Junior’s video games, etc.);•Commercially available files (Lotus, dBase, DOS, WordPerfect, etc.) that can be replaced at well-knowncost;•Proprietary files. These are almost impossible to replace, but how much are they worth? Their valueis in the time required to rebuild them multiplied by our labor cost.Once categories of files have been established and approximate values assigned, we can work out the totalvalue of each category by multiplying number of files times approximate value of each.
If the value is lessthan direct and time costs of backup, why should we do a backup? The most striking outcome (Nash JC and Nash M M, 1992) of such an exercise — easily carried out with a spreadsheet program — is that,on balance, it may NOT be worth backing up the whole file system. Saving the "important" files usuallywill have a net benefit. The conclusions depend on the particular costs, times, and values used.Such an analysis underlines the need to be selective in how we do backups. We stress that it is importantthat the back-up save the system organization, that is, directory structures and configuration files.An important adjunct to using risk/benefit analysis is the estimation of values for files.
Clearly, if a useris unable to put a cost to losing a file, it is not worth the bother of backing it up. We believe the exerciseof estimating file values is in itself helpful to users in assessing the relative importance of different aspectsof their work.On a practical level, back-up software should be chosen carefully to match personal needs andconvenience. We make the following observations:•Back-up to diskettes is very tiresome for all but the smallest collections of files. Tapes are much moreconvenient, especially for saving system organization and configuration.38Copyright © 1984, 1994 J C & M M NashNash Information Services Inc., 1975 Bel Air Drive, Ottawa, ON K2C 0X1 CanadaSCIENTIFIC COMPUTING WITH PCsCopy for:Dr.
Dobb’s Journal•There are significant performance differences between backup software. Some carry out the writingof data very quickly. Moreover, the efficiency of storage may vary widely, so that fewer backupvolumes may be needed with some backup software than others.•Some backup software saves data in a form accessible to regular programs. While may be less efficientin time or in storage space, it simplifies recovery of a single item.•We know victims of the following horror story. Backup is done in a regular, almost religious, way.Then, when a fixed disk "crashes" the data cannot be restored. We recommend testing any backupsystem for both backup and restore before putting much faith in it.
Note also that files saved by theMS-DOS BACKUP under one version of DOS cannot be restored by the RESTORE of another version.•Performing a "restore" to a new system is a fast way to configure it for use. (Don’t violate copyrightsin doing this.)•For networked systems, software that allows backup from one machine using a storage device onanother can be very helpful, since it minimizes some physical and logical work of the backup operator(Us!). We use Norton Backup Version 2 for this reason. It is also possible to backup one system bymirroring its fixed disk (or critical portions of it) on another machine’s fixed disk.
Note, however, thatthis may not provide adequate security against fire or flood damage.5.5ArchivingClosely related to backup is the question of archiving. At some stage in every project there are materialsto be put away for safekeeping. We do not wish to lose the information, but there is not likely to be aregular usage for some foreseeable time. Alternatively, we may wish to package several files together forshipment to a colleague or for distribution.
If we can also compress files as we archive them, we reducethe storage burden on our machine, though we cannot use the files directly.Over the years, many workers have developed ad hoc or formal programs to carry out the archiving task.On MS-DOS machines, there are many programs both commercial and shareware. We use the programLHA, which has the benefits of a small size, a single program for all functions, and quite goodcompression ratios. (Not all archiving programs carry out compression.) LHA is, however, slightly slowerin our experience than some other programs available.When packaging software for distribution, archiving programs may offer several useful features:•The files that make up the package are collected into a unit there is less chance for parts of thepackage to be mislaid.•Some archive programs allow the de-archiving routines to be placed in the archive file and the fileto be prepared as a "program".
Thus the archive becomes self-unloading. We simply run the program.This eliminates the need for the recipient of the archive to have the de-archiving program.•Compression of files into the self-unloading program or into the archive file reduces the disk spacerequirements and the telecommunications costs for transmitting the package over electronic mail ortelephone lines.•In some archivers, the unloader program allows a list of the contents of the archive program to bedisplayed. It is also helpful to have information on how the files have been packed.•It is helpful if the archiver can capture file system organization as well as just the files. LHA allowsthe user to archive and restore entire directories including subdirectories, which is extremely helpfulfor moving or distributing packages of files.•Archivers may have convenience features such as the capability for automatically deleting files thathave been archived.
Such features are helpful when we want to save many files into a single archive.5: FILE MANAGEMENT39The idea of compression and dynamic unloading has caught the imagination of several programmers.There are several commercial and shareware products that will compress executable program files andattach an unloader to the compressed files. The advantages of such tools are mainly storage savings(though loading may be slightly delayed). In particular, use of compression often permits a package tobe run from a single diskette, which is very useful when resources are limited, as in teachingenvironments.Products that claim to "double" disk capacity apply compression to entire disks.
For users who archivefiles regularly, the gains anticipated by "doubling" the fixed disk are quite limited, though we do use theprogram STACKER on our notebook computer. We caution that this program conflicted with othersoftware installed on another of our machines and had to be de-installed at the cost of considerable effort.5.6Version ControlDue to reluctance to erase an active file while a new variant is being tested or to delete a file until oneis absolutely sure the content of an updated file is correct, the ensemble of files may accumulate severalversions of essentially the same information. Whether the failure to delete "old" files is deliberate orabsent-minded, the extra files are a nuisance and a source of errors.
We must be constantly watchful thatthe proper file is used.The version control problem arises on all computers, large and small. The remedy requires discipline, andit is not a trivial task.The problems multiply when several users, each with his/her own machine, are working on one sharedproject. Clearly everyone wants the latest version of each file.
A complicating factor arises if these peopleare working at different locations. If machines can be physically connected, then we recommend that therebe just one master copy of each file. We have adopted this strategy ourselves in preparing this book. Bynetworking our machines, both of us can work on the same collection of files. The network softwareprevents both of us from having write-access to a single file simultaneously. Naturally there are overheadsand occasional annoyances in such a strategy, but our experience is that the benefits clearly outweigh thecosts.When networking is not possible, we recommend adopting a system by which each file is assigned atoken.
This may be a physical object, for example a button with the name of the file. Only the user inpossession of the token has the right to modify that file. This system works well when all users followthe rules. If they do not follow the rules, then it takes little imagination to predict the consequences.Some measures that can be taken to help in maintaining the file ensemble in good condition follow.•File storage can be systematized so that files of a similar nature or use are stored together. Thispermits the file ensemble to be segmented according to application and (hopefully) localizes allversions of one file.