Manual - FreeFileSync
Manual - FreeFileSync
Basic usage:
1. Choose left and right folders.
2. Compare them.
Note
For more detailed explanations on how to set up the most common synchronization scenarios, have a look at
the FreeFileSync video tutorials.
https://freefilesync.org/manual.php?topic=all 1/24
09/01/2019 Manual - FreeFileSync
1. Start comparison
2. Change comparison settings
3. Include/exclude specific files
4. Change synchronization settings
5. Start synchronization
6. Add folder pairs
7. Select left and right folders
8. Save/load configuration
9. Tree overview panel
10. Synchronization preview
11. Select categories to show on grid
12. Synchronization statistics
You can evaluate these codes from a script (e.g. a cmd or bat file on Windows) and check if synchronization
completed successfully:
"C:\Program Files\FreeFileSync\FreeFileSync.exe" "D:\Backup Projects.ffs_batch"
if errorlevel 1 (
https://freefilesync.org/manual.php?topic=all 2/24
09/01/2019 Manual - FreeFileSync
::if return code is 1 or greater, something went wrong, add special treatment
here
echo Errors occurred during synchronization...
pause
)
Instead of showing an error message, you can also send an email notification (using a third party tool).
Attention
If you are running the batch job unattended, make sure your script is not blocked showing a notification dialog.
Consider the following options when setting up the FreeFileSync batch job:
Set When finished to Exit to skip the summary dialog after synchronization.
Set up error handling to Ignore errors or Cancel to stop the synchronization at the first error.
Comparison Settings
https://freefilesync.org/manual.php?topic=all 3/24
09/01/2019 Manual - FreeFileSync
Comparison variants
When comparing two folders, FreeFileSync analyses the paths relative to the left and right base folders of the
contained files. If the relative path matches, FreeFileSync decides how the file pair is categorized by considering the
selected comparison variant:
equal
different size
Note
Under Windows the symbolic link options apply to symbolic links, volume mount points and NTFS junction
points.
Copying symbolic links requires FreeFileSync to be started with administrator rights.
The reason for this behavior lies in the way NTFS and FAT store file times: NTFS stores time in UTC format, while
FAT uses local time.
When times of these two different formats are compared, one format has to be converted into the other first. In either
way, Windows uses the current DST status as well as the current time zone for its calculations. Consequently, the
result of this comparison is dependent from current system settings with the effect that file times that used to be the
same show up as different after a DST switch or when the time zone has changed.
Solutions:
1. In FreeFileSync's comparison settings you can enter one or more time shifts to ignore during comparison: If you
need to handle differences due to daylight saving time, enter a single one hour shift. If the differences are caused
by changing the time zone, enter one or more time shifts as needed.
https://freefilesync.org/manual.php?topic=all 5/24
09/01/2019 Manual - FreeFileSync
Note
File times have to be equal or differ by exactly the time shift entered to be considered the same. Therefore,
the time shift setting should not be confused with a time interval or tolerance.
2. Alternatively, you can avoid the problem in the first place by only synchronizing from FAT to FAT or NTFS to
NTFS file systems. Since most local disks are formatted with NTFS and USB memory sticks with FAT, this
situation could be handled by formatting the USB stick with NTFS as well.
Files and directories are only considered for synchronization if they pass all filter rules. They have to match at least
one entry in the include list and none of the entries in the exclude list as presented in the filter configuration dialog:
Each list item must be a file or directory path relative to synchronization base directories.
Multiple items must be separated by | or a new line.
Wild cards * and ? may be used: * means zero or more characters while ? represents exactly one character.
https://freefilesync.org/manual.php?topic=all 6/24
09/01/2019 Manual - FreeFileSync
Note
For simple exclusions, just right-click and exclude one item or a list of items directly via the context
menu on main dialog.
A filter phrase is compared against both file and directory paths. If you want to consider directories only, you
can give a hint by appending a path separator.
Both slash (/) and backslash (\) can be used as the path separator character.
Expert Settings
FreeFileSync has a number of special-purpose settings that can only be accessed by manually opening the global
configuration file GlobalSettings.xml. Note that this file is read once when FreeFileSync starts and saved again
on exit. Therefore, you should apply manual changes only while FreeFileSync is not running. For the portable
FreeFileSync variant the file is found in the installation folder, for local installations go to:
Windows: %AppData%\FreeFileSync
Linux: ~/.config/FreeFileSync
macOS: ~/Library/Application Support/FreeFileSync
Contents of GlobalSettings.xml
FileTimeTolerance:
By default file modification times are allowed to have a 2 second difference while still being considered equal. This is
required by FAT/FAT32 file systems which store file times only with a 2-second precision.
RunWithBackgroundPriority:
While synchronization is running, other applications that are accessing the same data locations may experience a
noticeable slowdown. Enable this setting to lower FreeFileSync's resource consumption at the cost of a significantly
slower synchronization speed.
LockDirectoriesDuringSync:
In order to prevent multiple synchronization tasks from reading and writing the same files, FreeFileSync instances
are serialized with lock files (sync.ffs_lock). The lock files are only recognized by FreeFileSync and make sure
that at most, a single synchronization is running against a certain folder at a time while other instances are queued
to wait. This ensures that only consistent sets of files are subject to synchronization. The primary use case are
network synchronization scenarios where multiple users run FreeFileSync concurrently against a shared network
folder.
VerifyCopiedFiles:
If active, FreeFileSync will binary-compare source and target files after copying and report verification errors. Note
that this may double file copy times and is no guarantee that data has not already been corrupted prior to copying.
Additionally, corruption may be hidden by deceptively reading valid data from various buffers in the application and
hardware stack:
Does the CopyFile function verify that the data reached its final destination successfully?
NotificationSound:
Select sound files from the FreeFileSync installation directory to be played after comparison or synchronization. Set
empty names if no sound should be played.
https://freefilesync.org/manual.php?topic=all 7/24
09/01/2019 Manual - FreeFileSync
External Applications
When you double-click on one of the rows on the main dialog, FreeFileSync opens the operating system's file
browser by default. On Windows, it calls explorer /select, "%local_path%", on Linux xdg-open
"%folder_path%" and on macOS open -R "%local_path%". To customize this behavior or integrate other
external applications into FreeFileSync, navigate to Menu → Tools → Options → Customize context menu and
add or replace a command.
The first entry will be executed when double-clicking a row on the main grid or when pressing ENTER. All other
entries can be accessed quickly by pressing the associated numeric keys or via the context menu that is shown
after a right mouse click.
Note: To refer to the item on the opposite side, append "2" to the macro name: e.g. %item_path2%,
%folder_path2%, %local_path2%.
Examples:
Start file content comparison tool (WinMerge):
"C:\Program Files (x86)\WinMerge\WinMergeU.exe" "%local_path%" "%local_path2%"
Note
Macros need to be protected with quotation marks if they can resolve to file paths containing whitespace
characters.
Macros
All directory paths may contain macros that are expanded during synchronization. The beginnings and ends of each
macro are marked by a % character. In addition to special macros handling time and date, the operating system's
environment variables may also be used.
https://freefilesync.org/manual.php?topic=all 8/24
09/01/2019 Manual - FreeFileSync
Internal macros
Macro Example Format
%date% 2016-12-31 [YYYY-MM-DD]
%time% 112233 [hhmmss]
%timestamp% 2016-12-31 112233 [YYYY-MM-DD hhmmss]
%year% 2016
%month% 12 [01–12]
%day% 31 [01–31]
%hour% 11 [00–23]
%min% 22 [00–59]
%sec% 33 [00–59]
Hint: You can add a flexibility to an ffs_batch configuration file by creating new temporary environment variables in a
bat or cmd file that are evaluated by FreeFileSync at runtime:
https://freefilesync.org/manual.php?topic=all 9/24
09/01/2019 Manual - FreeFileSync
Example:
The FreeFileSync batch file C:\SyncJob.ffs_batch contains macro %MyVar% instead of an absolute target
folder and is invoked by a cmd file:
set MyVar=C:\Target
"C:\Program files\FreeFileSync\FreeFileSync.exe" C:\SyncJob.ffs_batch
::%MyVar% is resolved as C:\Target during synchronization
Note
Temporary environment variables created with the set command are only valid if the synchronization is started
by calling the FreeFileSync executable directly. Using start /wait would create a new program context
without these temporary variables.
Performance Improvements
FreeFileSync can be set up to issue multiple file accesses in parallel. This
speeds up synchronization times dramatically in cases where single I/O
operations have significant latency (e.g. long response times on a slow network
connection) or they cannot use the full bandwidth available (e.g. an SFTP server
that has a speed limit for each connection).
The number of parallel file operations that FreeFileSync should use can be set
up for each device individually in the Comparison Settings dialog. It is
evaluated for all folder pairs of a configuration as follows:
During comparison FreeFileSync groups all folders by their root devices.
For example, consider a configuration with two folder pairs and parallel file operations set up:
When synchronizing a folder pair FreeFileSync will use the maximum of the number of parallel operations that
the two folders support.
In the previous example the folder pair C:\Source ↔ D:\Target will be synchronized using 2 parallel
operations, and C:\Source2 ↔ E:\target will be using 3.
Note
FreeFileSync implements parallel file operations by opening multiple connections to a device. Some devices
like SFTP servers have limits on how many connections they allow and will fail if too many are attempted;
see (S)FTP Setup.
— Automated Synchronization —
The primary function of RealTimeSync is to execute a command line each time it detects changes in one of the
monitored directories, or when a directory becomes available (e. g. insert of a USB-stick). Usually this command
line will trigger a FreeFileSync batch job.
https://freefilesync.org/manual.php?topic=all 10/24
09/01/2019 Manual - FreeFileSync
RealTimeSync will register to receive change notifications directly from the operating system in order to avoid the
overhead of repeatedly polling for changes. Each time a file or folder is created/updated/deleted in the monitored
directories or their sub directories, RealTimeSync will run the command line.
Note
The command should not block progress. If you call a FreeFileSync batch job, make sure it won't show any
popup dialogs. See notes in Command Line Usage.
RealTimeSync will skip showing the main dialog and begin monitoring immediately if you pass an ffs_real
configuration file ora FreeFileSync ffs_batch file as the first command line argument to RealTimeSync.exe.
This can be used to integrate RealTimeSync into the operating system's auto start:
C:\Program Files\FreeFileSync\RealTimeSync.exe" "D:\Backup Projects.ffs_real"
C:\Program Files\FreeFileSync\RealTimeSync.exe" "D:\Backup Projects.ffs_batch"
RealTimeSync does not require to start FreeFileSync. It can also be used in other scenarios, like sending an
email whenever a certain directory is modified.
https://freefilesync.org/manual.php?topic=all 11/24
09/01/2019 Manual - FreeFileSync
Whenever directory H:\Data becomes available, RealTimeSync executes the command line which starts the batch
job located on the stick. RealTimeSync will also trigger each time files are modified in H:\Data.
Note
The full path of the last changed file and the action that triggered the change notification (create, update or
delete) are written to the environment variables %change_path% and %change_action%.
Note
When RealTimeSync executes a Windows batch file (bat or cmd) a black console window is shown. You can
hide it using the Visual Basic script HideConsole.vbs located in FreeFileSync's installation directory:
Limitations:
If multiple changes happen at the same time, only the path of the first file is written to
variable %changed_file%.
While RealTimeSync is executing the command line, monitoring for changed files is deliberately inactive.
The command line usually starts a synchronization task using FreeFileSync which naturally leads to additional file
change notifications. Therefore, the RealTimeSync change detection has to be deactivated to not go into an endless
loop. On the other hand, it is not likely that changes (other than those from FreeFileSync) happen in first place since
RealTimeSync runs the command line only after the user-specified idle time has passed. This makes sure the
monitored folders are not in heavy use. In any case, files changed during the execution of FreeFileSync will be
synchronized the next time FreeFileSync runs.
https://freefilesync.org/manual.php?topic=all 12/24
09/01/2019 Manual - FreeFileSync
https://freefilesync.org/manual.php?topic=all 13/24
09/01/2019 Manual - FreeFileSync
RealTimeSync should be monitoring while Windows is running, irrespective of currently logged-in users: Create a
new task in your operating systems's task scheduler and have it execute the command line above when the system
starts. See Schedule Batch Jobs for an example of how to add a task. Then change the user which runs the task
to SYSTEM - a special user account always running in the background.
2. By default, FreeFileSync will show a progress dialog during synchronization and will wait while the summary
dialog is shown. If the progress dialog is not needed, enable checkbox Run minimized and also set Auto-
Close if you want to skip the summary dialog at the end.
Note
Even if the progress dialog is not shown at the beginning, you can make it visible at any
time during synchronization by double-clicking the FreeFileSync icon in the notification area.
3. If you don't want error or warning messages to stall synchronization when no user is available to respond, either
check Ignore errors or set Cancel to stop the synchronization at the first error.
https://freefilesync.org/manual.php?topic=all 14/24
09/01/2019 Manual - FreeFileSync
Use quotation marks to protect spaces in path names, e.g. "D:\Backup Projects.ffs_batch"
Note
Program/script always needs to point to an executable file like FreeFileSync.exe even when the ffs_batch
file association is registered. If an ffs_batch file was entered instead, the task would return with error code
2147942593 (0x800700C1), "%1 is not a valid Win32 application".
If you schedule FreeFileSync to run under a different user account, note that settings
(e.g. GlobalSettings.xml) will also be read from a different path, C:\Users\
<username>\AppData\Roaming\FreeFileSync, or in the case of the SYSTEM account
fromC:\Windows\System32\config\systemprofile\AppData\Roaming\FreeFileSync.
https://freefilesync.org/manual.php?topic=all 15/24
09/01/2019 Manual - FreeFileSync
Drag and drop action Files & Folders/Open Finder Items and add it to the workflow.
The Calendar app will start automatically with the Automator job scheduled to the current day. You can now
select a different time for synchronization or make it a recurring task.
https://freefilesync.org/manual.php?topic=all 16/24
09/01/2019 Manual - FreeFileSync
https://freefilesync.org/manual.php?topic=all 17/24
09/01/2019 Manual - FreeFileSync
Synchronization Settings
The Two way variant already creates database files, therefore, detection of moved files is always active.
The Mirror variant however, does not need the database files to find synchronization directions, so detection of
moved files is not available by default. If you don't mind the creation of the database files, you can enable this
feature by selecting the Detect moved files checkbox.
Note
Detection of moved files is not yet possible when synchronizing a folder pair for the first time. Only beginning
with the second syncthe database files are available to determine moved files.
Detection is not supported by all file systems. Most notably, certain file moves on the FAT file system cannot
be detected. Also virtualized file systems, e.g. a mounted WebDAV drive, might not support move detection.
In these cases FreeFileSync will automatically fall back to copy and delete.
https://freefilesync.org/manual.php?topic=all 18/24
09/01/2019 Manual - FreeFileSync
Note
In case the (S)FTP server sets file modification times to the current time you can do a Compare by File
Size as a workaround. Another solution is to set up the Two way variant and have the files with the newer dates
be copied back from the server during the next synchronization.
The folder reading time is reduced by a factor of N x M when using N connections with M channels each.
Example: 10 connections using 2 channels each can yield a 20 times faster folder reading.
The creation of additional connections and channels takes time. If you are only scanning a small remote folder,
setting up too many connections and channels might actually slow the overall process down. Creating extra
connections is slower than creating extra channels.
SFTP servers have internal limits on the number of allowed connections and channels. Generally, servers expect
one connection per user, so this number should be kept rather low. If too many connections and channels are
used, the server may decide to stop responding.
Unlike connections, additional SFTP channels are (currently) only used during folder reading (comparison), but
not during synchronization.
Advice
Start with low numbers and make tests with different combinations of connections and channels for your
particular SFTP synchronization scenario to see what gives the highest speed. Note, however, that
FreeFileSync reuses existing SFTP connections/channels. Therefore, you should restart FreeFileSync before
measuring SFTP speed.
https://freefilesync.org/manual.php?topic=all 19/24
09/01/2019 Manual - FreeFileSync
Unmount:
fusermount -u mountpoint
Move a window by clicking on a free area and holding the mouse button:
https://freefilesync.org/manual.php?topic=all 20/24
09/01/2019 Manual - FreeFileSync
Open a batch configuration for edit via the Windows Explorer context menu:
Drag and drop two folders at a time from Windows Explorer to fill a folder pair in one go:
Copy files selected on the main dialog to an alternate folder and thereby save a "diff":
https://freefilesync.org/manual.php?topic=all 21/24
09/01/2019 Manual - FreeFileSync
Remove obsolete paths from the folder drop-down list by pressing the Delete key:
Select a time span for files to include via the date column context menu:
https://freefilesync.org/manual.php?topic=all 22/24
09/01/2019 Manual - FreeFileSync
Note
It is not required to look up and enter the volume name manually. Just
select the corresponding entry in the drop down menu.
The working directory is then automatically set to E:\ by the operating system so that the relative
path \folder will be resolved as E:\folder during synchronization.
File Versioning
When you need to preserve files that have been deleted or overwritten, it's often sufficient to select Recycle bin in
synchronization settings. However, this is only available for local drives and offers little control on how to store and
how long to keep the files. FreeFileSync therefore has an additional option, Versioning.
B. With naming convention Time stamp [Folder] files are moved into a time-stamped subfolder of the versioning
folder while their names remain unchanged. This makes it easy to manually undo a synchronization by moving
the deleted files from the versioning folder back to their original folders.
Example: Last versions of the file Folder\File.txt inside folder D:\Revisions
https://freefilesync.org/manual.php?topic=all 23/24
09/01/2019 Manual - FreeFileSync
D:\Revisions\2012-12-12 111111\Folder\File.txt
D:\Revisions\2012-12-12 122222\Folder\File.txt
D:\Revisions\2012-12-12 133333\Folder\File.txt
Note
The volume snapshot created by the Volume Shadow Copy Service is only used for copying files that are
actually locked.
Accessing the Volume Shadow Copy Service requires FreeFileSync to be started with administrator rights.
Troubleshooting
If you experience problems using the Volume Shadow Copy Service, a renewal of registration might help. Create
and execute a cmd batch file and insert the following lines or enter directly via command line:
cd /d %windir%\system32
Net stop vss
Net stop swprv
regsvr32 ole32.dll
regsvr32 oleaut32.dll
regsvr32 vss_ps.dll
Vssvc /register
regsvr32 /i swprv.dll
regsvr32 /i eventcls.dll
regsvr32 es.dll
regsvr32 stdprov.dll
regsvr32 vssui.dll
regsvr32 msxml.dll
regsvr32 msxml3.dll
regsvr32 msxml4.dll
https://freefilesync.org/manual.php?topic=all 24/24