MIRROR 1.22 Partial File Server Mirroring Program Chris Owen c.owen@qut.edu.au December 7 1993 MIRROR Allows partial mirroring of Novell file servers. It was written to allow a group of file servers connected via a metropolitan area network to supply programs to student laboratories on different university campuses. Files can be localised to the campus, but managed on one master server. At QUT, NetWare Name Service is used to synchronise the binderies and login scripts ensuring that users have accounts on all servers. MIRROR is used to synchronise the program files and trustee rights to ensure that software packages and users only need to be managed on one file server. The MIRROR program ensures that the directory structure on a target file server matches that on a source file server. Files or directories which are on the source but not on the target are created. Files on the target but not on the source are deleted. If a file has a different last modified date or size on the two servers it is copied from the source. File attributes are also copied across with the file. Options may be supplied to also copy ownership information, directory and/or file trustees. Ownership and trustee mirroring is done using the user name rather than the object ID as this will generally differ between servers. A configuration file contains a list of target subdirectories to mirror. All sudirectories below the target are done recursively. If a file cannot be copied (eg because it is open or has a lock on it), it is logged to a retry file which may be used as a new configuration file for a subsequent attempt. MIRROR must be run by SUPERVISOR or a user with SUPERVISOR security equivalence. It runs on a DOS workstation, and only supports the default DOS namespace. MIRROR v1.22 - Partial File Server Mirroring Usage: MIRROR /switches Where = name of configuration file = name of file to log failures for retrying = name of master server = name of slave server to bring in sync switches: /a = see only files with archive bit set /i = mirror directory and file information (ownership etc.) /t = mirror directory trustees /f = mirror file trustees /d = delete trustee assignments for non-existent objects /s = skip subdirectories /sim = simulate only, no changes to target /v = verbose mode, slower but shows what's happening /ns = disable supervisor equivalence check The configuration file contains lines of the form: sourcevol:sourcepath/filespec [destvol:destpath] eg: sys:home/* vol1:users sys:system/*.nlm sys:public/* If no destination path is specified, the same path is used on each server. Note that the wildcard *.* will NOT match any filename without an extension! Use * to select all files (C) 1993, Chris Owen, Queensland University of Technology Other uses ---------- Upgrading servers: MIRROR is used here when upgrading file servers. The old server is backed up and restored to the new server which is then tested. Users are shut out for a few minutes while their user directories are MIRRORed to get all the last minute changes. The new server can then be brought up and users keep going. Moving data between volumes: It has also proved useful for moving directories between volumes or servers to make better use of disk space. Critical near line backups: A tape backup job run each evening clears the archive bit. Using the /a flag, a frequently run MIRROR job is used to take an online backup of critical directories. This ensures that a mirror image of files modified since the last tape backup are available, and protects against work lost between a crash and a recent backup. If a file on the source has the archive bit changed from set to cleared or is deleted, any copy on the target will be deleted. This ensures that only the minimum amount of data needed to reconstruct the disk is kept, and eliminates restoring old copies of files which have since been deleted. Support ------- I can't guarantee any level of support, but if you do have problems with MIRROR, let me know and I'll do my best to accommodate you. If you are using MIRROR and have access to e-mail, please drop a note to me and I'll put you on a mailing list for notification of upgrades. DISCLAIMER ---------- This program has undergone a reasonable amount of testing to ensure that it works correctly, and has been in regular use for some 12 months in a production environment using NetWare 3.11 and 2.15 servers without failure. However, no responsibility is taken by QUT or the author for any loss of data or damage the program may cause. Also, MIRROR is not guaranteed to work with future versions of NetWare. You use it at your own risk! This program was written in C++ using Novell's NetWare C Interface for DOS Version 1.2 and compiled with Borland C++ Version 3.1. Copyright (C) 1993, Chris Owen, Queensland University of Technology, All Rights Reserved. Permission is granted to copy freely and use, provided this file accompanies the program. MIRROR may NOT under any circumstances be sold, or included in any packages for which a fee is charged. Revision history ---------------- 1.22 7/12/93 - Fixed /s behaviour. It was deleting orphaned subdirectories with or without the /s switch. Now /s won't touch subdirectories. Thanks Tim Bouwer for pointing this one out. - Added /sim switch. This simulates a run without changing anything, and when used with the /v switch will provide a list of what would be changed during a real run. 1.21 1/11/93 - Added /ns option to disable check for supervisor equivalence. This can be used to do a trial run on a directory to which only R F rights are available. The retry file lists what would be mirrored when run with the extra rights. This can also be used to mirror a subset of a directory by tailoring rights so only part of it can be seen. Note that MIRROR cannot mirror trustees unless you have access control or supervisor rights in both source and target directories. 1.2 27/8/93 - Added /a option to allow MIRROR to backup critical files between tape backups. This was done after a soft crash on a server resulted in two 1G volumes being trashed, losing 6 hours work and many e-mail messages for 20 staff. High disk MTBF's are well and good, but a disk failure is not the only way to lose data! 1.13 20/7/93 - Fixed bug which ignored duplicate object names in trustee list (eg. trustees to user and group of the same name). Previously only one of the trustees was carried across. 1.12 21/5/93 - Fixed bug which occasionally reset file info (including last modified time) of target file to that of the modified source file, without copying the file first. This could cause files with different contents but the same sizes to be made to appear the same to MIRROR and thus be skipped. For example, if a the master copy of a file was modified in such a way as not to change its size, and this bug occurred the next time MIRROR was run, it would not be replaced on subsequent attempts. 1.11 6/4/93 - Added /s option to skip mirroring of subdirectories. Subdirectories on source and target are ignored with this option. 1.1 12/2/93 - Added ability to specify different source and target directories in configuration file. - Fixed bug deleting read-only files on target server. - Added deletion of invalid trustees objects. Trustees may become invalid if a bindery object is deleted without deleting its trustee assignments. 1.01 3/2/93 - Added handling of blank lines in control file. These are now just skipped. - Fixed problem with directory handles not being deallocated. - Added code to flush retry file buffer, so abnormal termination won't lose this. 1.0 - Original version