DirSynch
A directory sinchronization tool.
Visit the DirSynch project page at GitHub.
Tipical usage
- Select the main directory.
- Select the second directory.
- Hit the "Load" button and wait for the file list to be filled.
- Analyse the list and uncheck the files you don't want to synchronize (you can use the Tools->Select menu or the toolbar).
- Hit the "Synchronize" button and wait until it finishes (a progress bar will be shown).
- If the operation is successful, when you click "OK" in the "Success" message window the list will be reloaded.
System requirements
Needed files
Files for this help
- DirSynch-help.html
- main-screen-small-1.6.png
- toolbar-1.6.png
- v.gif
- x.gif
Optional files
Command line parameters
I use this to create specific icons on my desktop, for each dir I usually synchronize.
java[w] -jar DirSynch.jar [Params]
Params:
-main [main dir path] Set the main dir.
-sec [sec dir path] Set the secondary dir.
-keep Keep backups.
-prop [properties file path] DirSynch.properties file path.
--help | -help | -h | /? Show this usage message.
Tools
- Select
- All
- Select all files, except the equal ones.
- None
- Unselect all files.
- Only YES/no
- Select only the files that exists in one dir and not in the other.
- Only in main dir
- Select only the files that exists in the main dir and not in the second.
- Only in sec dir
- Select only the files that exists in the second dir and not in the main.
- Newer in main
- Select only the files that are newer in main dir than in the second.
- Newer in sec
- Select only the files that are newer in the second dir than in the main.
- Sel/Unsel with regexp...
- Let the user enter a regular expression (Java syntax) to select or unselect the files.
This command does not change the selection status of the files that don't match.
Toolbar
The toolbar has the following buttons:
- Select all
- Unselect all
- Select only in main dir
- Select only in sec dir
- Select newer in main dir
- Select newer in sec dir
- Select with regexp...
- Unselect with regexp...
Options
- Include subdirs
- If set, include all subdirectories, if not, ignore the subdirectories. Default: checked.
- Use hash
- If this option is set, the file comparison will be performed in the following way:
- Compare the files sizes.
- Calculate and compare the files MD5 hash, if the sizes are the same.
- Compare the files times, if the MD5 hashes are different.
If the option is unset, the file comparison will be performed in the following way:
- Compare the files times.
- Compare the files sizes, if the times are the same.
WARNING: Calculating hashes can be a very slow process! Use with care, specially if you're synching lots of files or large files.
- Hide equals
- If this option is set, the files considered equals are not shown in the list.
- Keep backup
- If this option is set, the destination files are copied with ".bak" extension before overwritting.
- Synch times for same hashes
- Sometimes files that are equals (having the exact same content -- and the same hash) have different times.
If this option is set, these files will have only the times synchronized without being copied again.
This option will slow a little the process, because the hash will be calculated for files with same size and different times.
- Log options...
- This option will show a dialog where you can: select the log file to be used, select the log level (from "none" to "debug" -- very verbose) and if the log file will have the new log messages appended to the end or if the file will be overwritten each time the program runs.
- Load options...
- Load the options (including the main and sec dirs) from a ".properties" file.
- Save options...
- Save the current options (including the main and sec dirs) to a ".properties" file.
The .nosynch file
To avoid synching some directory or file, just put it in a file (one per line) and save this file with the name ".nosynch" or "_nosynch". Note that if you don't want to synch this file, you also will need to put it on the list. The files listed in the nosynch file will not be shown in the list.
The file can be located in one of this places:
- In the main dir.
- In the second dir.
- In the user dir (according to the operating system).
Notice that all files found in those places will be loaded and used to avoid synching. Currently the case must be the same (case sensitive).
All files and directories with the names listed will be skipped. For example: if you put "TEMP" in the _nosynch file and there are two directories with this name, in the main dir and inside a subdir "MyDir", both will be skipped and all its subdirs.
The nosynch files are read every time the list is loaded, so you can change it "on the fly", without closing the program.
Wildcards
The lines in the .nosynch file that starts with the character "|" (pipe) are processed as
regular expressions. The syntax is the one from java.util.regex.Pattern class.
For example:
|.+\.zip
- This line matches all files with the extension ".zip" (case ignored), so those files won't be synchronized.
Tips
When I create a .nosynch file, I put ".nosynch" in the first line, to avoid synching itself.
I usually also put a line with "|.+~", to avoid copying backup files created by Vim.
My third line (when in Windows) usually is "Thumbs.db", as they're protected files and cause errors when I try to synch them.
Known issues
If two files have the same times, but different sizes, they are marked as "BIG" (bigger) and "sml" (smaller).
DirSynch ignores those files when synchronizing.
License
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
A copy of the GNU General Public License is distributed in this
package as file named LICENSE. If you
can't find this file, you can access the full license text in
http://www.gnu.org/licenses/gpl-3.0.txt
To see the future plans, please access our issue tracker page.
History of versions:
v1.6.1 (23/07/2021):
v1.6 (10/09/2009):
- Bug: Issue Java.net #1 - When a file is open, the synch fails with no error msg
- Bug: Issue Java.net #18 - Save options dialog doesn't show dirs
- Issue Java.net #4 - Interface for the options that are only in the .properties file
- Issue Java.net #13 - Toolbar with common tools
- Issue Java.net #17 - Change plain threads to SwingWorker
- Issue Java.net #19 - Update help file to v1.6
v1.5.2 (28/05/2008):
- Added and changed some INFO and DEBUG levels log messages
- Bug: When there is no .nosynch (or _nosynch) file or there is no wildcard pattern in it, the load operation hangs.
v1.5.1 (21/05/2008):
- Added and changed some INFO and DEBUG levels log messages
- Bug: when used the command line parameters to specify the main and sec dirs, the load config from .properties file fails to update the dirs
v1.5 (17/05/2008):
v1.4.1 (31/01/2008):
- Added some INFO level log messages
v1.4 (26/01/2008):
- New option: Only adjust times if files have same hash value
- Fix bug for files with/without "/"
- Log levels: NONE, ERROR, WARNING, INFO, DEBUG
- Calc hash only for files with same size when synching times
- DirSynch.properties creation
- Options:
hash.enabled=[boolean] (default: false)
hash.onlysmall=[boolean] (default: true)
hash.smallmaxsize=[size in Kb] (default: 256)
subdirs.include=[boolean] (default: true)
hide.equals=[boolean] (default: false)
log.level=[NONE, ERROR, WARNING, INFO, DEBUG] (default: WARNING)
log.file=[path to file] (default: .\DirSynch.log)
- Command line new option: -prop=[properties file]
- Mnemonics in menu itens
v1.3 (13/01/2008):
- Progress bar in synch (show the file name being copied and the percent of number of files)
- Progress bar in load.
- Select / Unselect : all/YES-no/New-old
- Option "Include subdirs" (default true)
- New interface for options (menu)
v1.2 (30/11/2007):
- Show file status:
"Filename.ext - Main: 10/11/06 17:07:09 10.3Kb - Sec: 10/12/06 8:07:23 10.4Kb''
- Log failure details
- Use hash (true = Size -> Hash -> Time; false = Time -> Size)
- Help
- About
v1.1 (28/11/2007):
- Checkbox to select/unselect itens
- Implement synch
- _nosynch
- Disable Sync button when any dir changed
- Fix bug: duplicated entries (one for Main, one for Sec)
- Option "Hide equals"