RealtimeSync's primary function is to trigger synchronization immediately after files in a source directory have changed. However its implementation is much more flexible to cover an even broader range of use: A list of directories provided by the user is monitored for changes. Whenever a file within these directories or sub directories is modified OR the directory becomes available (e. g. insert of a USB-stick), RealtimeSync responds by executing the user-specified command line.
Example: (Real time synchronization - in combination with FreeFileSync)
First start up RealtimeSync.exe located in FreeFileSync's installation directory. Then specify all directories that shall be monitored. Instead of doing this manually you can simply import a *.ffs_batch file via Menu -> File -> Load configuration. This not only extracts all directories relevant for synchronization but also sets up the command-line to execute the *.ffs_batch file each time changes are detected. Now press "Start" to begin monitoring.
Note:
The command-line must NOT
block the progress. If a FreeFileSync batch file is called
make sure it is operating in "silent-mode" and "error
handling” is set to "ignore errors" or "exit
instantly".
The settings dialog can be skipped
by passing a RealtimeSync configuration file (*.ffs_real)
OR a FreeFileSync batch file (*.ffs_batch)
as first command-line argument. This allows for integration with
the operating system's auto start facility.
Using RealtimeSync is not
restricted to starting FreeFileSync. It can also be used in other
scenarios, like sending an email whenever a certain directory is
modified.
"C:\Program
Files\FreeFileSync\RealtimeSync.exe"
"C:\MyConfig.ffs_real"
"C:\Program
Files\FreeFileSync\RealtimeSync.exe" "C:\SyncJob.ffs_batch"
Example: (Automatic synchronization when USB stick is inserted)
Assume you have multiple USB sticks that contain data you want to automatically synchronize whenever you insert one of the sticks into the PC. Save the relevant configuration on each USB stick's root directory to have it called when the stick is mounted. Then configure RealtimeSync analog to the following:
Whenever directory "H:\Data" becomes available, the command-line executes and starts the batch job whose configuration is located on the stick. Furthermore it also starts the batch job each time files are modified in "H:\Data".
Example: (Calling a custom .cmd or .bat file)
For additional convenience it may be nice if the batch job remains silent if synchronization completes successfully, otherwise shows FreeFileSync's GUI dialog when errors occurred. Therefore create two configurations, one silent-mode batch to be called by default and one *.ffs_gui to be called when former fails. Then replace the command-line to simply execute a batch file similar to this one:
::first
check whether USB-stick contains a sync-configuration at all
@if
exist "H:\Silent_Config.ffs_batch" (
::configuration
found, now execute the synchronization batch job
"C:\Program
Files\FreeFileSync\FreeFileSync.exe"
"H:\Silent_Config.ffs_batch"
@if
not errorlevel 0 (
::if
something went wrong, start FreeFileSync in GUI
mode
"C:\Program
Files\FreeFileSync\FreeFileSync.exe"
"H:\GUI_Config.ffs_gui"
)
)