Short: Mirror drives, homepages, etc.. (v1.4) Author: Sönke Tesch Type: util/cli Architecture: m68k-amigaos mirror is a small Shell command that creates or updates exact copies of a directory. It basically does the same "delete backup_dir all" plus "copy source_dir backup_dir all clone" would do, however mirror is way faster since it only touches the files that have been modified or deleted in the source location, instead of copying the entire directory. In addition, mirror copies links as links, i.e. not creating a new file on each link it encounters like copy will do. mirror comes with an install script and translations for half of Europe :) I originally wrote this tool to update the files on my Internet site at kino-fahrplan.de: the server is mounted as Amiga drive with FTPMount (a fine piece of software also available from Aminet), but instead of copying (and probably deleting) everything by hand from my local work directory to the server it can now be done with just one call of mirror. Took me a some days to notice that this tool is also useful to create backups of my harddisk and keep them up-to-date. With just 10k it's probably the smallest backup application available :) Short explanation of the arguments: -------------------------------------------------------------------------------- SOURCE/A,DESTINATION/A,NODELETE/S,NOUPDATE/S,NOCOPY/S,IGNOREDATE/S,IGNORECOMMENT/S, IGNOREFLAGS/S,IGNOREALL/S,QUIET/S,VERBOSE/S,LOG/K SOURCE/A = Name of directory to move files from. DESTINATION/A = Name of directory to move files to. These options control what to do with files in DESTINATION: NODELETE/S = Do not delete files that do not exist in SOURCE. NOUPDATE/S = Do not copy files that have been modified in SOURCE. NOCOPY/S = Do not copy new files from SOURCE. If any of the following is set, mirror will not compare and not copy that file/directory attribute. IGNOREDATE/S = Do not care about dates. IGNORECOMMENT/S = " " comments. IGNOREFLAGS/S = " " protection flags. IGNOREALL/S = IGNOREDATE+IGNORECOMMENT+IGNOREFLAGS QUIET/S = Do not print any status information at all. VERBOSE/S = Keep status information visible. Press Ctrl-C to stop mirror completely. Press Ctrl-E to stop work in the current directory. Press Ctrl-F in QUIET-mode to view current status line. mirror returns 5 on any modifications, else 0. -------------------------------------------------------------------------------- This help text is also available by entering "mirror ?" and, at the prompt, entering another "?". - A note on IGNORE...: mirror usually compares files by testing if date and size match. In FTPMount'ed directories it is not possible to set file attributes like date and comment. Since this may cause some confusion you can ask mirror to skip checks on the file date, flags and/or comment and only look after the file sizes. IGNOREALL is a shortcut for IGNOREDATE, IGNORECOMMENT and IGNOREFLAGS - A note on delete- or write-protected files: mirror does not care about the protection bits! If there is something to delete in the destination because it does not exist in the source anymore, mirror _will_ delete it. Same applies to write-protection. Try NODELETE and/or NOUPDATE if you want to be on the safe side. - A note on links: If it's not possible to create a link in the destination directory, mirror will simply copy the source file instead. If you have any comments or find bugs, please drop me a line: my address is . Known bugs and "Things that look like bugs but aren't" ====================================================== Errors with FTPMount'ed volumes: - "invalid object lock" and/or "packet request type unknown" These errors are displayed after mirror tried to set the date, flags or comment of a file or directory that exists on an FTPMount'ed volume. The reason is simply that FTPMount does not support these actions. However, these errors only apply to the setting of the file attributes, the file has at that point already been copied. You should use the IGNORE-arguments if working with FTPMount'ed directories. See also: History paragraph for 1.1. - "object not found" If an ftp-server is not mounted upon access to a file it sometimes returns "object not found". Upon the second access to the same file it's there. This behaviour seems to confuse mirror somehow and I didn't yet find out where exactly the problem is. Unfortunalty mirror then runs crazy on sub-directories and copies some files to sys: instead of the destination. If you get a DOS-error 24 (no idea what that means, it's returned by DOS), you know it'll suck :] You should better have your FTP volumes connected before mirror'ing. Hard links in RAM disk: The RAM disk has a bug regarding hard links. If you create a link and then write something to the original file, the link turns into a real file with the old contents of the original. History ======= 1.4 14.5.2001 public Aminet release - Serious bug in the procedure that copies hard linked directories caused mirror to crash. - In some cases the destination directory was not unlocked upon copying links. - Double attribute cloning produced wierd errors ("unknown dos-packet"). - Directory names on status lines were not correctly aligned. 1.3 - Only copied attributes (comment, protection, date) of directories, not files. - Directory is always the one of the last change in that directory. mirror first copied the date and then copied the objects in that directory, so in the end the destination directory date was not the one of the source but of the last copied object in the destination. 1.2 4.1.2001 Beta release - New file locking mechanism added to 1.1 prevented mirror from copying files to FTPMount'ed drives. FTPMount always returned "object in use". 1.1 3.1.2001 Translator release - Copies hard links as links, not as files. - Added IGNORECOMMENT and IGNOREFLAGS and changed behaviour of IGNOREDATE to help work with FTPMount. - mirror now creates real clones, including file protection bits and comments. - Minor speed-ups here and there. 1.0 30.12.2000 Translator release