SFSync is a file synchronization program. It compared the file modification time (mtime) and size to decide if a file is modified. It keeps a local database to keep track of changes (remote / local). It also works with Android devices without root via ssh (SSHelper etc) where the file attributes (time etc) can't be set.
It uses the following paradigm:
sync locationsare places in the local filesystem that are synchronized against some other place
- if you want to sync against multiple places, create multiple sync locations for the same folder!
protocolsare protocols that are used to synchronize against the same remote location
- you can e.g. use sftp and a samba mount in parallel, with different remote roots, while the same cache database is used.
subsetsare used to synchronize only part below a root. Often, there are only certain folders that I modify and I don't need to sync all folders everytime.
- You don't need an initial sync of everything! I found this to be not acceptable in many cases.
- The log file
/tmpor in java.io.tmpdir
- SFSync has an option keep separate remote file date/timestamp/mtime for servers that can't modify file time (android & SSHelper without root etc.)
- sftp: use publickey or password-based authentification (password stored in settings, hashed but not very secure)
- sftp: remote symbolic links (symlinks) are not 'followed'
File synchronization is a delicate thing. However, if you keep the Files list-view on the default setting "changes", only files are modified that you see in the list. You can review everything before pressing
- I use it since years without any data loss
- There is no sanity check before synchronization, so you can create the paradox to delete a folder but copy a child file. This will result in nice synchronization errors, but no data loss will happen.
- The routine that assigns the initial actions after file scan is tested on program startup. Check the code, I find this is safe.
- But I can't be responsible for any data loss, of course.
How to use
- Get the Java JRE >= 8u101. Don't forget to untick the crapware installer, and/or disable it permanently!
- Download the zip for Mac or (Windows, Linux), extract it somewhere and double-click the app (Mac) or jar file (Windows, Linux).
Everything should be self-explanatory (watch out for tooltips).
How to develop, compile & package
- Get Java JDK >= 8u101
- Clone the repository
- I use the free community version of IntelliJ IDEA with the scala plugin for development, just import the project to get started.
Run Reftool from terminal and package it:
- Install the Scala Build Tool
- Compile and run manually:
- Package for all platforms:
sbt dist. The resulting files are in
Contributions are of course very welcome, please contact me or use the standard methods.
- Scala and Scala Build Tool
- Scalafx as wrapper for JavaFX for the graphical user interface
- sbt-javafx to create the runnable Reftool jar file
- sbt-buildinfo to access build information
- sbt-appbundle to create the mac app bundle
- a modified version of universalJavaApplicationStub to launch Reftool on Mac
- SSHJ to synchronize via sftp