DoWalnutIntervalCompact <oldRootFileName> <newRootFileName> (<earliest>) (<latest>)
<oldRootFileName> describes a running or runnable Walnut DB.
<newRootFileName> describes the destination DB; both root file and LoganBerry DB df file
must already exist.
 <Earliest> must be a date and time; <latest> may be a time and date or (.), meaning "now"
Copyright Ó 1991, 1992 by Xerox Corporation. All rights reserved.
Swinehart, October 25, 1991 4:55 pm PDT
Doug Terry, January 28, 1992 4:28 pm PST
Willie-s, April 27, 1992 2:23 pm PDT
alias MAYBE command
Change that to "echo" to test the script.
MAYBE Require Cedar WallTapestry WalnutUtils
Date
setproperty oldRootFileName ($(WalnutFile $1))
setproperty newRootFileName ($(WalnutFile $2))
MAYBE CloseAll
MAYBE walnut -n $oldRootFileName
MAYBE Sleep 5
MAYBE Waitt
setproperty rootDirectory ($(DirectoryOf $newRootFileName))
setproperty logFileName ($rootDirectory$(WalnutFile $newRootFileName log))
setproperty dbFile ($(WalnutFile $newRootFileName db))
setproperty dbDirectory ($(DirectoryOf $dbFile))
setproperty shortDB ($(ShortNameOf $dbFile))
MAYBE WCDetails off
MAYBE Delete $logFileName
setproperty earliest ($(ScriptDefault . ($3)))
setproperty latest ($(ScriptDefault . ($4)))
Echo Compacting Walnut Database $oldRootFileName to $logFileName, between $earliest and $latest
MAYBE time WalnutCompact $oldRootFileName $logFileName ($earliest) ($latest)
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 $newRootFileName lblog))
MAYBE LBFlush ALL
push $dbDirectory
For now, leave user's DB specification alone, and just reinitialize it.
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
MAYBE CloseAll
Echo Scavenging $newRootFileName
MAYBE WalnutScavenge $newRootFileName
MAYBE Sleep 5
MAYBE Waitt
MAYBE LBParam -cacheSize 2500 -cacheStretch 1000 -writeCaching off
Echo Scavenge of $newRootFileName complete at ($(date)). Delete $oldRootFileName and its database once you've produced new databases for each active interval. $newRootFileName has been left in read-only state.