Java Replication Utility (jru)

is a command-line tool that recursively copies a source directory to a target directory. Obviously, backups to fileserver-shares or second partitions can be done very simple in this way, though there are more purposes of course.

Sounds easy - what is special about jru?

- Only new or changed files are actually copied. Thus the process is very fast, especially when used as a "daily backup". The Default-Implementation considers last-modified-dates in order to decide whether the copy of a certain file is necessary or not. Thus, no additional control data is needed to keep track of the replications.

- Unlike typical copy-commands, the tool will not abort if it fails to copy a certain file for some reason. It will continue with the next file.

- Unlike typical copy-commands, the target directory is exactly like the source directory. Old files in the target directory do not remain. Thus, after a data loss the target directory simply has to be copied back in order to go back to the point where the last replication has been done. Rolling back the target-directory to the source-directory can be done using simple (os-builtin) copy-commands.

- Deleted files can be stored in a third directory, called the trash-directory. Erroneously deleted files can be recovered from here. When a trash-directory is used, every file in the target-directory that is not in the source-directory (any more) is moved from target to trash.

- Thanks to the Java language, the tool runs on linux-, windows- and other machines


Installation and Usage:
- Think of a place to store the replications/backups, in jru-wording the target- and trash-directories. The place must be write-accessable using a path. Usually this applies to local harddrives, fileserver shares and cards, but not to cds, dvds or tapes.
- Install a JavaRuntimeEnvironment (JRE) version 1.2 or higher
- Download the file de.axelrosenthal.jru.jar and place it whereever you like
- run a command according to the following usage:

java -classpath <path to jru.jar> de.axelrosenthal.jru.Replicator <path to source-directory> <path to target-directory> <path to trash-directory>

As always in java, you have to make sure that the java-command is found in your PATH.


Further hints
If you really, really do not want to use a trash directory, you can enter <delete> as 3rd parameter (instead of the trash-directory). In this case, the obsolete files in the target directory will be deleted. If you enter <keep> as 3rd parameter, the files will remain.


API
As jru is written in Java, it can be used from other Java-Applications of course. Just have a look at the static method replicate from class Replicator. It's all you need to start a replication.


Future plans:
- Powerful and flexible logging-features
- Improvements in the possibility to change/extend the behaviour of the tool by special implementations. In other words: A little framework will be defined