WalnutRescueDoc.tioga
Copyright © 1985 by Xerox Corporation. All rights reserved.
Willie-Sue Orr, August 15, 1985 10:12:59 am PDT
WALNUTRESCUE
CEDAR 6.0 — FOR INTERNAL XEROX USE ONLY
WalnutRescue
Willie-Sue Orr
© Copyright 1985 Xerox Corporation. All rights reserved.
Abstract: WalnutRescue provides a number of facilities to be used to recover from problems with or changes to Walnut.
Created by: Willie-Sue Orr
Maintained by: Willie-Sue Orr <Willie-Sue.pa>, Jim Donahue <Donahue.pa>
Keywords: Walnut, recovery
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
General introduction
All of the following commands, except Recover, use a typescript viewer called "Walnut Rescue". There are load files for each.
WalnutRescue
Provides three commands: ScanWalnutLog, FixWalnutLog, and QuickFixWalnutLog. WalnutRescue.load makes sure that the WalnutKernel files are running;
% ScanWalnutLog logFile
logFile: the full path name of a Walnut log file; if not given a logFile, it will use the Walnut.WalnutRootFile profile entry to guess at a log name.
Opens a typescript viewer, reports progress, and summarizes the types, numbers of, and total bytes in the various log entries, and give information about invalid or trashed entries. The ~'s represent 10 entries seen.
You should not have the Walnut control window active if you are trying to scan its current log.
% FixWalnutLog rootFile {ATOMs for entries to be ignored}
rootFile: the full path name of a Walnut root file; entriesToIgonore is a sequence of atom names of entries that are to be removed from the log file - remember: case is important in specifying atoms. Will use the Walnut.WalnutRootFile profile entry if rootFile is not given.
This procedure makes use of Walnut's expunge code; it reads the current log and writes the expunge log, removing the entries specified, and any entries that are not valid for the current version of Walnut. In addition, it removes trashed entries, writing the orphaned bytes on the file <wDir>WalnutRescue.orphanedBytesLog. At the end of Fix'ing, the log is guaranteed to be a legal Walnut log. The root file is re-written to point to the now-current log. When you next start Walnut, you will be forced to do a scavenge.
Walnut cannot be active while you run Fix.
% QuickFixWalnutLog rootFile
rootFile: the full path name of a Walnut root file. Will use the Walnut.WalnutRootFile profile entry if rootFile is not given.
This procedure makes use of Walnut's expunge code; it reads the current log and writes the expunge log, removing ONLY the second entry if it is trashed - otherwise this code does not do anything; it writes the orphaned bytes on the file <wDir>WalnutRescue.orphanedBytesLog. At the end of QuickFix'ing, the log is guaranteed to be a legal Walnut log. The root file is re-written to point to the now-current log. When you next start Walnut, you will be forced to do a scavenge.
Walnut cannot be active while you run QuickFix.
MoveWFiles
Provides one command: MoveWalnutFiles.
% MoveWalnutFiles destinationServer LIST-OF-WalnutRootFiles
This is intended for use by an Alpine Administrator. It provides for moving a user's set of Walnut files from one server to another. It opens a typescript viewer.
Each rootFile in the list is read; all of the files it names are moved to the destinationServer, preserving all their properties. The rootFile is then re-written to name the new files, and it is written to the destinationServer. If there were not errors, the original rootFile is deleted from the sourceServer; the other files are not deleted.
RecoverNewMail
Provides one command: Recover.
% Recover fileName {num}
Recover provides a way to force-feed a new mail log to Walnut. fileName should NOT have "'s around it. num is optional; it defaults to 1 (as the number of messages in the file).
Recover will copy the FS-file fName onto the newMailLog - it had better be a bonafide Walnut newMailLog. The Walnut control window will not notice that there is something on the log, but bugging NewMail will read it.
ScanFileForMsgs
Provides one command: ScanForMsgs.
% ScanForMsgs file startPos( ← 0) endPos( ← endOfFile)
ScanForMsgs provides a way to find the msgs in a Walnut log file.
ScanForMsgs will scan the file (including an alpine file), starting at startPos and reading up to endPos. Non-msg entries are ignored. Any msgs found will be written on Walnut's log using WalnutOps.CreateMsg. They will appear in the Active MsgSet (unless they already exist in the database - no feedback in the current version). At the end, WalnutControl will be told to redisplay any changed data. You may not do other Walnut activities while running ScanForMsgs.
While ScanForMsgs is running, it prints a '. for each message, and a '! for each non-message entry that it sees; (multiple-of-10) is for messages, {multiple-of-10} is for non-message counting.
ScanForMsgs is a good example of using WalnutWindow.QueueCall and various WalnutOps procedures.