Managing a MUMPS installation

The following discussion deals with using MUMPS on FreeBSD. For linux and any other O/S, the principles need to be followed but the files and directories may be different.

To start up MUMPS on system start, add a shell script like:
#!/bin/sh
# Start the MUMPS environemnt
/usr/local/bin/mumps -j40 -g32 /mumpspath/mumpsdb
sleep 2
/usr/local/bin/mumps -x 'J ^startup H' /mumpspath/mumpsdb
into /usr/local/etc/rc.d/ and set it executable.

The following line needs to be inserted in /etc/rc.shutdown after the line: # Insert shutdown procedures here

/usr/local/bin/mumps -x 'K ^$J' /mumpspath/mumpsdb
To use journaling, set it up by going into single user mode:
1. Shutdown MUMPS if it is running
2. mumps -j1 mumpsdb
3. mumps mumpsdb

then, SET ^$SYSTEM("VOL",1,"JOURNAL_FILE")="/path/journal_file"
and   SET ^$SYSTEM("VOL",1,"JOURNAL_REQUESTED")=1
then  KILL ^$J to exit MUMPS
and re-start normally.
Note that the journal_file must not exist at this stage but must be read/writable by the group attached to the mumps executable.
Journalling on each individual global (including ^$ROUTINE) is turned
on with: SET ^$GLOBAL("global","JOURNAL")=1
     eg. SET ^$GLOBAL("$ROUTINE","JOURNAL")=1 to journal all routine changes.
When a global is created, it takes it's JOURNAL value from ^$GLOBAL("$GLOBAL","JOURNAL"). Set this to 1 to journal all new globals.

To examine the current journal status:

WRITE ^$SYSTEM("VOL",1,"JOURNAL_AVAILABLE") for 1/0 = on/off
WRITE ^$SYSTEM("VOL",1,"JOURNAL_SIZE") for the current size of the
journal file in bytes.
To zero the current journal file, SET ^$SYSTEM("VOL",1,"JOURNAL_SIZE")=0.

To backup a MUMPS system, use a shell script like:

#!/bin/sh
#
/usr/local/bin/mumps -x 'S ^$S("VOL",1,"WRITELOCK")=1' /one/onedb
sleep 5
mt rew
dump -0uaf /dev/nrsa0 /
sleep 10
mt fsf
dump -0uaf /dev/nrsa0 /usr
sleep 30
/usr/local/bin/mumps -x 'S ^$S("VOL",1,"JOURNAL_SIZE")=0' /one/onedb
/usr/local/bin/mumps -x 'S ^$S("VOL",1,"WRITELOCK")=0' /one/onedb
mt offline
Obviously, leave out the journal line if journalling is not in use.