FileMirrorSync - A file mirror synchronization tool
FileMirrorSync is a simple one-way file synchronization tool (incremental file copy).
It may be used to maintain an identical copy of the files in a directory tree, e.g. as a backup copy.
The program compares the sizes and last modification times of the files in the source directory tree
against those in the target directory tree.
Then it updates the target directory tree by copying the different files,
and by deleting and renaming files and directories as necessary, to make the target identical to the source.
- Written in Java. Requires Java 7 or newer.
- Based on the new java.nio.file package.
- Command-line interface (no GUI).
To copy (mirror-synchronize) the files from c:\myfiles to d:\mybackup:
java -Xmx500M -jar filemirrorsync.jar c:\myfiles d:\mybackup
(The "-Xmx" option is only necessary if you have very much files.
It's used to increase the maximum heap memory size of the Java VM (to 500 MBytes in the example).)
java -jar filemirrorsync.jar [options] sourcePath targetPath
Path of the source directory or source file
Path of the target directory
Only list the file and directory differences, without copying or changing anything.
Specifies whether case should be ignored when associating source
file/directory names with target file/directory names.
This is automatically done when one or both of the file systems
Specifies whether file/directory names should be renamed when the names of
the source and target files/directories only differ in case.
Tolerance in milliseconds for comparing the last modified time of files.
This should be set to 1999 (nearly 2 seconds) when mirroring files to a FAT
file systems from a non-FAT file system, because the FAT file system only
has a 2 seconds resolution.
Specifies whether time offsets of +/- 1 hour should be ignored.
Offsets of +/- 1 hour may occur when one copy of the files is stored on a
file system that uses UTC time (e.g. NTFS), and the other version on a
file system that uses local time (e.g. FAT).
Specifies whether files and directories that have both the system and the
hidden attributes set should be ignored. When enabled, files and
directories with these attributes are ignored in the source and in the
target directory trees.
Verbosity level between 0 and 9.
Debug level between 0 and 9.
Codes used in the output
|A||add to target||source exists, target does not exist
|M||modify target||source and target exist but are different
||R||rename target||source and target exist and are equal, but file name upper/lower case characters differ
|D||delete from target||source does not exist, target exists
Author: Christian d'Heureuse (www.source-code.biz, www.inventec.ch/chdh)