EBZ/CED 14 Jan 98 CFL SYNCING ----------- * Sync_cfl is a procedure to synchronize the /mdisw/cfl trees between mdicmd and mdisas. It will be run daily by cron, but may also be called at any time using the following instructions. This procedure is designed to sync up the cfl trees, but it may be used to synchronize any directory or else mirroring may be used. * MDICMD is the master computer and /md92 is the master filesystem, MDISAS is the slave computer and /md80 is the slave filesystem. * Sync_cfl should be run on MDICMD because running sync_cfl on mdisas will not work since it is not possible to copy anything from mdisas to mdicmd. * The default of this procedure is as follows: If a file exists only on mdicmd then it will be copied to mdisas. If a file exists only on mdisas then it will be copied to mdicmd. If there is a conflict, mail will be sent out. * Cron runs this with the parameters: -export='cp', -import='mail', -conflict='mail'. This means that if a file exists only on mdicmd then it will be copied to mdisas and if a file exists only on mdisas or if there is a conflict between the two, mail will be sent out. The output of a cron mailing will consist of the command line called and the list of files that were different between the master and the slave and an export, import, deletion, or update scripts to fix this. The export script will distribute files from the master to the slave. The import script will distribute files from the slave to the master. The deletion script will delete files found only on the slave. The update script will update files on the slave system with the newer version found on the master system. * Description of sync_cfl and instructions on usage: sync_cfl: CFL tree synchronizer, v2.5 (13-Jan-98) Usage: sync_cfl [options] [file] Sync_cfl is normally used by cron, to synchronize the /mdisw/cfl trees between mdicmd and mdisas. It is easily generalizable to other applications. You supply a "master" and a "slave" filesystem, a fixed part ('cfl') of the directory path under each filesystem ('cfl'), a set of directories ('dirs') under the path, and a set of subdirs ('subdirs') under each directory that require updating. Here's an example breakdown of a particular complete path: /md92/mdi_egse_sw/cfl/flight/src \_ _/ \______ _____/ \_ __/ \ / | \/ | | master or cfl dir subdir slave If you don't specify any subdir at all, then all subdirs of the master directory are updated. MDI has to own the cfl directory on the computers needed to be synced File inventories are compared between the master and slave directories, and files are copied forward or backward as necessary to synchronize the two directories. You may specify actions for three different cases: export (when the slave lacks a file posessed by the master) import (when the master lacks a file posessed by the slave) conflict (when the master and slave have different files with the same name) Example: Update the /md80 tree based on the /md92 tree. Update the src, dep, and ip subdirs of the flight and flight-util directories. Automatically copy files in the forward direction; automatically delete spurious files in /md80; and send mail to admin@mdisas when conflicts are found. sync_cfl -master='/md92' -slave='/md80' -cfl='mdi_egse_sw/cfl' \ -dir='flight,flight-util' -subdir='src,dep,ip' \ -export='cp' -import='rm' -conflict='mail' \ -mail='sync-cfl@mdisas' (Note that most of the default parameter values are well-chosen). Accepted switches are: -export none,mail,cp: file is on master only. (default 'cp') -conflict none,mail,replace: files don't match (default 'mail') -dirs CFL subtrees to synchronize (default 'flight,flight-util') -mail To whom does mail go? (default 'sync-cfl@mdisas') -cfl CFL tree rel. to master/slave dir (default 'mdi_egse_sw/cfl') -verbose Be chatty (default '') -help Print this help message (default '') -exclude Regexp for files to exclude (default '^[\.\+]') -slave Location of mdisw tree for slave (default '/md80') -import none,mail,rm,cp: file is on slave only. (default 'mail') -master Location of mdisw tree for master (default '/md92') -subdirs Subdirs of each CFL subtree to synch. (default 'src,dep,ip') -n If set - do nothing; only notify (default '') Accepted switch forms are: -foo (sets switch 'foo' to '1' [1] [TRUE]) -nofoo (sets switch 'foo' to '' [0] [FALSE]) -foo=bar (sets switch 'foo' to 'bar').