This program sychronizes two directories. Files are compared by their size and date, hashing of the file content is optional. This qualifies the software for synchronization of large remote file systems. For a more detailed description of the motivation behind the project and a comparison to other tools available please read the corresponding blog article.
- compares files by size and date, hashing is optional
- log output can be forwarded via Jabber
- compares large directories in reasonable time even if one of the directories lies in a remote file system
The software is intended to work in batch mode and thus performs bidirectional synchronization only without conflict resolution of any kind. If a file was modified on both sides, the older one being dismissed and overwritten by the newer one. (It should be no problem, however, to add a feature like a --dont-overwrite-conflicting-files with a few lines of additional code.) That being said, the second thing you have to think about is that you need a Java JRE. The Open JDK 6 JRE works pretty well with the program on my server, just apt-get install default-jre.
Remember to backup your files, this software comes with ABSOLUTELY NO WARRANTY.
For available options see the help page:
Usage: java -jar synctool-1.0.8.jar <source path> <destination path> [(-f|--dbfile) <database file>] [(-l|--logfile) <logfile>] [(-j|--jabber) <jabber address>] [(-r|--server) <jabber server>] [(-u|--user) <jabber user>] [(-p|--password) <jabber password>] [-d|--dry-run] [-h|--hashing] [-i|--ignore-directory-attributes] [-s|--silent] [--debug] [-?|--help] <source path> the source path <destination path> the destination path [(-f|--dbfile) <database file>] the path to the database file to use (default: synctool) [(-l|--logfile) <logfile>] the path for a logfile to write [(-j|--jabber) <jabber address>] send logging output as jabber message to the given address [(-r|--server) <jabber server>] the jabber server to connect to [(-u|--user) <jabber user>] the jabber user name used for logging in to the server [(-p|--password) <jabber password>] the jabber password used for logging in to the server [-d|--dry-run] perform a trial run with no changes made [-h|--hashing] generate MD5 file hashes for exact comparison [-o|--rolling-logfile] generate a rolling logfile with a maximum size of 10 MB [-i|--ignore-directory-attributes] do not copy attributes for directories [-s|--silent] do not print "Entering directory" and "No operation" messages [--check-file-exists
] perfom synchronization only if the given file exists [--debug] print debug messages [-?|--help] print help and exit
java -jar synctool.jar -i -s -l sychronization.log /media/hidrive /media/usb/localdrive
SyncTool is provided under the Apache License 2.0:
Copyright 2011 Tilman Walther
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Remember to backup your files!
This software was made possible by the following components:
- The H2 database to keep track of the files
- log4j for logging
- The Apache Commons library
- JSAP to parse the command line
- Smack XMPP library