DoWalnutCompact <rootFileName>
Copyright Ó 1991, 1992 by Xerox Corporation. All rights reserved.
Swinehart, March 15, 1992 5:06 pm PST
Doug Terry, February 12, 1992 9:34 am PST
Willie-s, April 27, 1992 2:22 pm PDT
alias MAYBE command
Change that to "echo" to test the script.
Require Cedar WallTapestry WalnutUtils
Date
setproperty rootFileName ($(WalnutFile $1))
MAYBE CloseAll
MAYBE walnut -n $rootFileName
MAYBE Sleep 5
MAYBE Waitt
setproperty rootDirectory ($(DirectoryOf $rootFileName))
setproperty logFileName ($rootDirectory$(WalnutFile $rootFileName log))
setproperty oldLog ($(FindTemp $logFileName))
setproperty dbFile ($(WalnutFile $rootFileName db))
setproperty dbDirectory ($(DirectoryOf $dbFile))
setproperty shortDB ($(ShortNameOf $dbFile))
MAYBE WCDetails off
MAYBE Delete $logFileName.new*
Echo Compacting Walnut Database $rootFileName to $logFileName.new
MAYBE time WalnutCompact $rootFileName $logFileName.new
Echo Pausing for ten seconds. The next procedures will disable or delete mail system files.
Echo If any step beyond this point fails, seek assistance from Walnut
Echo Support personnel.
Echo Push STOP now to abort the scavenge.
MAYBE Sleep 10
setproperty lbLog ($(WalnutFile $rootFileName lblog))
setproperty oldLbLog ($(FindTemp $lbLog))
MAYBE Rename $oldLog ← $logFileName
MAYBE LBFlush ALL
MAYBE Rename $oldLbLog ← $lbLog
MAYBE Rename $logFileName ← $logFileName.new
push $dbDirectory
MAYBE Delete *.lbindex
MAYBE Delete $shortDB
MAYBE LBCreate $shortDB Key MsgSet ShowIs $2 $3 $4
For now, leave user's DB specification alone, and just reinitialize it.
setproperty goesTo ">"
MAYBE MakeEmptyLBLog $lbLog
Believe it or not, that puts a single termination character into the LB log file.
MAYBE LBBuildindices $shortDB
pop
MAYBE LBParam -cacheSize 15000 -cacheStretch 15000 -dateCompare on -caching on -writeCaching on
Echo Scavenging $rootFileName
MAYBE WalnutScavenge $rootFileName
MAYBE Sleep 5
MAYBE Waitt
MAYBE LBParam -cacheSize 2500 -cacheStretch 1000 -writeCaching off
Echo Scavenge of $rootFileName complete at ($(date)). Previous log saved as $oldLog. Delete it whenever you feel comfortable doing so.
MAYBE CloseAll
MAYBE walnut $rootFileName