EBZ 17 March 1998 EBZ/CED July 1999 EBZ/RIB July 2000 MIRRORING & MSPUT ----------------- MIRRORING: * The mdisw tree mirroring is done nightly by cron, or can manually be mirrored using msput or trig_mirror via mail gateway, or by executing what is in crontab file. CFL directories are mirrored by sync_cfl. * MDISAS is master for most files on the mdisw tree, so only make changes to files on MDISAS. The only files that don't have MDISAS as the master are /mdisw/dbase and /mdisw/health and those don't have a master. * The master distribution file is a list of the directories to be mirrored and which computer is the master of that directory. This file is located on /mdisw/mirror/mdisw_distrib.tab. * On ~mdiswms there are 3 crontabs running in crontab.src: mirror_cal_info mirrors the /mdisw/dbase/cal/info files on MDISAS, MDITLM, and DISPASON - trig mirror updates these hourly mdisw_distrib.mirror runs the mirroring from the mdisw_distrib.tab file and logs it to mirror_log - this is run daily on MDISAS, MDICMD, MDITLM, URANIA, DIAPASON, FAULT, SHAWNEE, MDISIM go_update_ssw updates the ssw tree - only runs on MDITLM, MDICMD, URANIA, FAULT If MDICMD is not on the main distribution list then periodically update it by hand - this should be done every few months if the EGSE versions are synced or after new syncing. First make a backup somewhere else on CMD and then copy over the new one by calling mirror or using tar: on mdicmd: cd /md80/mdi_egse_sw tar cf - . | (cd /mdisw;tar xvf -) Some secondary directories are updated between mdisas, mdicmd, diapason, and mditlm via the file /mdisw/mirror/mdisw_distrib2.tab. * Mail triggered mirroring (msput, trig_mirror) arrives as mail to mdiswms with a Subject line that indicates the operation to be done and a list of directories to which it should be done. * To add another computer to the mirroring list: copy /mdisw/mirror to the new machine make a user mdiswms on new machine copy the user mdiswms home directory (~mdiswms) from SAS to new machine edit mdisw_distrib.tab and add the machine name to the top of the file edit /mdisw/mirror/.setup_mirroring to add the new host edit /mdisw/setup/setup_cal to add the new machine to the environment variable MDI_MAIL_SERVER files needed for cron mirroring: DISTRIBUTION DESCRIPTIONS: /mdisw/mirror/mdisw_distrib.tab /mdisw/mirror/mdisw_distrib2.tab /mdisw/mirror/mdisw_ditsrib3.tab PROGRAMS: /mdisw/mirror/file_distrib.mirror /mdisw/mirror/.setup_mirroring /mdisw/mirror/mdisw_mirror CRON ENTRY: /var/spool/cron/crontabs/mdiswms files needed for mail mirroring: ~mdiswms/.forward ~mdiswms/mail_trig_log/deparse_mail_log.txt ~mdiswms/mail_trig_log/deparse_mail_mirror.txt /mdisw/mirror/mdisw_distrib.tab /mdisw/mirror/deparse_mail.pl /mdisw/mirror/mdisw_mirror_extra /mdisw/mirror/file_distrib.mirror /mdisw/mirror/.setup_mirroring * Here's the sequence of how mail triggered mirroring works: `~mdiswms/.forward' contains the string "|/mdisw/mirror/deparse_mail.pl", a perl script that pulls the command from the subject line and the destination director(y|ies) out of the mail, and executes the appropriate commands. For mirroring, deparse_mail.pl runs the file /mdisw/mirror/mdisw_mirror_extra which parses the distribution description in /mdisw/mirror/mdisw_distrib.tab to find the appropriate master source for the directory, generates a temporary one-directory distribution file, and then calls /mdisw/mirror/file_distrib.mirror to do the actual mirroring. (The temporary distribution file gets deleted). Log files are left in `~mdiswms/mail_trig_log/*.run.info'. Both "deparse_mail_log.txt" and "deparse_mail_mirror.txt" must exist in ~mdiswms/mail_trig_log. * Description of trig_mirror (to manually mirror a file/directory): NAME TRIG_MIRROR PURPOSE To mirror a directory or list of directories on a certain machine or list of machines. INPUTS Argument 1: The directory or comma separated list of directories. Argument 2: The node to send it to, if nothing is specified then it mails to the nodes defined in $MDI_MAIL_SERVER. Optional argument: a -m in either the second or third parameter will cause a mail message to be sent back when the job has finished. EXAMPLE USAGE trig_mirror /mdisw/idl,/mdisw/dbase/ops diapason -m trig_mirror /mdisw/idl/ucon -m NOTES The program looks at the file /mdisw/mirror/mdisw_distrib.tab to determine if the directory is mastered. However, you can enter subdirectories of those directories and it will use the tab file entry to mirror that directory. * Description of msput (to manually put an updated version of a file in all the proper directories): NOTE: msput only works from the machine that is listed as master NAME: msput PURPOSE: To copy a file onto the /mdisw tree CALLING SEQUENCE: msput filename.pro msput *.pro msput filename.pro directory msput mmap*.pro directory msput filename.pro directory /noback METHOD: * "msput" is called with a list of the files that should be put on-line. * The last parameter can be a directory where the file should be copied (do NOT include trailing /) * The routine does the following: 1. Check if the routine is already on-line 2. If on-line and you specified a directory, check that it is the same directory. If not, do not copy the file 3. If it is replacing a copy that is already on-line, move the copy to a backup directory 4. Check that the file specified in the list does actually exist and is not a directory 5. Issue the copy command SWITCHES: /noback - do not make a copy of the file being replaced in the /mdisw/save_copy directory /qdebug - echo debugging statements /nodelete - do not delete or backup the file (needed when putting essential setup script files on-line)