NAME
ventiprog, fossilize, storescore, cpsys, fosreset, fossilstart, foshalt – backup between ventis, replicate fossils, and archive rootscores

SYNOPSIS

ventiprog [ –p prepfile ] [ –f infofile ] [ ventihttp_dialstring ]

fossilize [ partition ] [ fsname ]

storescore

cpsys source dest

fosreset rootscore [ partition ] [ ventiaddr ]

fossilstart [ partition ] [ srvname ]

foshalt

/n/9fat/rootscor

/n/9fat/wrcmd

DESCRIPTION
These commands aid in the maintenance and replication of venti/fossil servers. See fossil(4) and fossilcons(8) for an overview of the fossil system, fossil/last, flfmt –v, and venti(8) and venti–backup(8) for an overview of venti and replication with wrarena.

Note that these commands make certain assumptions about system configuration and require some manual setup and additional administrative actions for use as a complete backup/replication workflow. As with all system administration scripts, please study their interaction with your local environment before use.

Overview
These scripts help perform the workflow of replicating between active ventis, replicating fossils that make use of them, and preserving the fossil rootscores. There is a set sequence of operations to correctly replicate active venti/fossil systems. First, and not automated by these scripts, an active fossil(4) must be taking snapshots. This happens automatically, or can be triggered by sending the comand fsys main snap –a to the fossil console. The workflow of ventiprog and related commands assumes that the desired snapshot operation has been completed.

Venti replication
After the desired snapshot is finished (which may simply be the automatic daily snapshot) the fossilize of a given partition prints the output of fossil/last , mounts a 9fat partition if necessary, and appends the rootscore to /n/9fat/scores.$fsname which is taken as a conventional storage location for fossil rootscores and venti offset data. Two optional parameters may be provided, first a partition location, and second the value of fsname, which will otherwise default to $sysname. Rootscores need to be kept secure so this file should be treated in the same manner as nvram.

storescore is a small helper script which stores its input, conventionally produced by fossilize in the form of a vacscore and system fsname, in the 9fat partition appended to the file scores.fsname

After a snapshot has been completed and the rootscore saved, replicating data from the venti used by that fossil to other ventis will make that rootscore available for use. The task of progressively replicating data between ventis is given to the ventiprog script. Prior to using ventiprog , the user must create the file bkup.info which begins with the dialstring of the venti to which data will be replicated. Each time ventiprog is run it updates this file with a new final clump offset parameter. The optional parameters to the ventibackup script are [–p prepfile] [–f infofile] [ventihttp_dialstring] which allow you to specify an additional script to run (prepfile) prior to the main backup operation, a differently named infofile rather than bkup.info (perhaps beginning with a different dialstring for a different target venti), and a different http address to dial than the default of 127.1:8000.

Fossil replication
Resetting running fossils to a different score and replicating fossils between systems is done with fosreset , which uses vacscore to flfmt–v the given partition using the ventiaddr given. If no parameter is provided the environment value of $venti will be used and if a partition is absent /dev/sdC0/fossil will be used as a default. The script first uses the simplified fossil–only foshalt script to sync and halt the fossil, then kills all running fossil processes before issuing the flfmt–v command.

cpsys automates replicating between the fossil of source system and that of dest system. IMPORTANT: this script assumes that the partition identification is the same on both systems. It also requires the rexexec(8) service to be listening on both source and destination machines. It issues the fossilize command to source and saves the output to create the parameters for a fosreset command sent to dest.

Because running fossils are halted by the actions of fosreset and cpsys , the fossilstart script assists in restating the fossil located on a given partition using standard default parameters. If srvname is given, it will be used as a stem for the fossil file and also its fossilcons(8)

EXAMPLE
These commands are issued from a venti(8) server.
% rcpu –h fs –c 'echo fsys main snap –a >>/srv/fscons'
# begin a snap and then wait for it to complete
% ventiprog
# assumes the user has a bkup.info file with the first line
# venti=tcp!target.venti.ip.addr!17034
% unmount '#S' /dev
% rcpu –h fs –c fossilize |storescore |rcpu –h backup –c storescore
# get most recent fs rootscore to store locally and on backup venti
# the unmount is needed to prevent remote systems seeing local disks
% cpsys fileserver backupserver
# reset the backup fossil to the rootscore of the snapshot

After this seequence, the backup server can choose to use one of the ventis which also contains the replicated rootscore. Usually this is done by changing the value of the $venti variable in plan9.ini(8)

SOURCE
/sys/src/ants/scripts/ventiprog

SEE ALSO
fossil(4), fossilcons(8), venti(8), venti–backup(8)

BUGS
Managing the namespace seen by remote servers during rcpu commands can lead to partition identification troubles.

NOTE
The foundation of the ventiprog script is taken and modified from /sys/src/cmd/venti/words/backup.example