.\" Process this man page with .\" groff -man -Tascii mxautosave.8 .\" .TH MXAUTOSAVE 8 "October 2011" "MX Administrator Manuals" .SH NAME mxautosave \- MX save/restore program .SH SYNOPSIS .B mxautosave [ .I options .B ] .I mxautosave_dat_filename savefile1 [ savefile2 ] .SH DESCRIPTION .B mxautosave is a save/restore utility which is normally started as a server by the .B mx(8) init script. However, it can also be directly invoked by users to manually save or restore individual sets of MX and/or EPICS database variables. .I mxautosave_dat_filename is a file listing the database variables that are to be saved or restored during this invocation of .B mxautosave. The format of this file is described further in the man page .B mxautosave.dat(5). .I savefile1 and the optional .I savefile2 are the names of the files that database variables are saved to or restored from. The format of this file is described in the man page .B mxautosave_format(5). If both filenames are specified on the command line and no option flags have been specified, then .B mxautosave will look at the newer of the two files to see if the file is a complete save file with the last line containing the string "********". If the last line with the string of asterisks is not present, .B mxautosave assumes that a previous invocation of .B mxautosave crashed while in the middle of writing out the save file. In this case, .B mxautosave looks at the older of the two save files and looks to see if that file has the terminating string of asterisks. Once .B mxautosave has found the newest available complete save file, it attempts to restore the values in it to the MX and/or EPICS database variables specified in .B mxautosave.dat. If no complete save file is found, then .B mxautosave does not attempt to restore any values. If it is running as a server, periodically .B mxautosave writes a snapshot of the current values of the variables specified in the file .B mxautosave.dat to one or the other of the two specified savefiles. .B mxautosave alternates back and forth between the two savefiles, first overwriting one and the next overwriting the other. The intention here is to maximize the chance that one of the two savefiles is a valid complete savefile. The default period for this operation is 30 seconds. .SH OPTIONS .IP "-d level" sets the debugging level to the specified value. .IP "-l log_number" specifies which of the logs to use from the available values of LOG_LOCAL0 to LOG_LOCAL7. Note that you specify the numerical value alone without LOG_LOCAL in front of it. .IP "-L log_number" does the same thing as the .I -l option, except that messages are also logged to stderr in this case. .IP "-P default_display_precision" specifys how many digits after the decimal point are to be displayed in values written to the save file. .IP -R tells .B mxautosave to start up without attempting to restore from a save file. .IP -r tells .B mxautosave to restore a set of database variables from the specified file and then exit. This is intended for use in manual restores of parameters. .IP -s tells .B mxautosave to save a set of database variables to the requested file and then exit. This is intended for use in manual saves of parameters. .IP "-u update_interval" specifies an alternate interval for writing out savefiles in seconds. The default value is 30 seconds. .SH EXAMPLES Note that the normal value of the environment variable MXDIR in the following is /opt/mx. The conventional way to start .B mxautosave is implicitly via the standard MX init script $MXDIR/sbin/mx with a command line like /opt/mx/sbin/mx start If you want to directly start .B mxautosave in the way that the .B mx(8) script does it, use a command like /opt/mx/sbin/mxautosave /opt/mx/etc/mxautosave.dat \ /opt/mx/state/mxsave.1 /opt/mx/state/mxsave.2 If you want to manually save the database variables described in the file .I mylist.dat to the save file .I mysave.dat, use a command line like /opt/mx/sbin/mxautosave -s mylist.dat mysave.dat If you want to manually restore the database variables described in the file .I mylist.dat from the save file .I mysave.dat use a command line like /opt/mx/sbin/mxautosave -r mylist.dat mysave.dat .SH FILES .I $MXDIR/etc/mxautosave.dat - default configuration file that describes the set of variables to be saved or restored. .I $MXDIR/state/mxsave.1 and $MXDIR/state/mxsave.2 - these are the save/restore files used by .B mxautosave if started through the standard .B mx(8) init script. .SH SEE ALSO .B mxautosave.dat(5), mxautosave_fmt(5), mx(8) .SH AUTHOR William Lavender