Adding features to Create Synchronicity
(from a blog post I wrote in 2016, halfhourhacks 2016-02-11-adding-features-to-create-synchronicity.html)
Create Synchronicity is a lightweight open source backup and synchronization program. After choosing a source directory and a destination directory, it will send updated files from the source to the destination. It supports previewing, scheduled actions, filtering by file type, and checksum verification.
Although I use dedicated backup software, I've found Create Synchronicity useful for ad-hoc synchronization like maintaining a mirror of my music library on an external hard drive. I recently modified Create Synchronicity's source code to add some new features to make it even more useful.
Adding a Context Menu
After selecting item(s) in the Preview list, right-click to show my new context menu.
- Show Differences...
-
- Highlights differences between the files, using winmerge.exe or other diff/merge software.
- Copy Source to Destination...
-
- Selectively sync only the files that are highlighted, after showing a preview.
- Copy Destination to Source...
-
- "Reverse sync" (from destination to source) the files that are highlighted, after showing a preview.
- Keep Source and Destination...
-
- In some cases, you want to keep both the source version of the file and the destination version of the file. In order to do this, "Keep Source and Destination" appends a timestamp to the destination filename and copies the file to both locations, after showing a preview.
Other features I added
First press Ctrl+Alt+E to enable expert features. Then, the Settings page will show this menu in the bottom left:
<li style="margin-top:1.0em">Show yellow icon if destination is newer</li>
<li style="list-style-type:none">
<ul>
<li style="margin-top:1.0em">When in "strict mirror" mode, show a yellow icon for files where the destination (about to be overwritten) is more recent than the source.</li>
</ul>
</li>
<li style="margin-top:1.0em">Optimization when MD5 and compare file size are enabled</li>
<li style="list-style-type:none">
<ul>
<li style="margin-top:1.0em">I changed the logic to reduce the number of checksums computed.</li>
</ul>
</li>
<li style="margin-top:1.0em">Check for newly added contents before deleting folders</li>
<li style="list-style-type:none">
<ul>
<li style="margin-top:1.0em">Time can pass between the user running Preview and Sync. New files added during this window can be potentially deleted if the parent directory is marked for deletion in the Preview. Turn on this check to eliminate the race condition.</li>
</ul>
</li>
<li style="margin-top:1.0em">Tests</li>
<li style="list-style-type:none">
<ul>
<li style="margin-top:1.0em">Low level tests cover every branch of newly added functions, every combination of file/folder, create/update/delete. Component tests write to a temp directory and verify all directories, file contents written as expected.</li>
</ul>
</li>