Command Line Usage
FreeFileSync supports additional synchronization scenarios via a command line interface.
To get a syntax overview, open the console, go to the directory where FreeFileSync is installed and type:
FreeFileSync.exe -h or FreeFileSync --help
1. Run a FreeFileSync batch job
To start a synchronization in batch mode, supply the path of a
.ffs_batch
configuration file as the first argument after the FreeFileSync executable:
FreeFileSync.exe "D:\Backup Projects.ffs_batch"
After synchronization, detailed results are written to standard output in
JSON format.
You can parse this output with a
script to add further customizations.
To check if synchronization was successful, evaluate the process exit code:
Exit Codes
0 Synchronization completed successfully
1 Synchronization completed with warnings
2 Synchronization completed with errors
3 Synchronization was cancelled
Windows: A batch script (
.cmd/.bat) that evaluates this code may look like this:
"C:\Program Files\FreeFileSync\FreeFileSync.exe" "D:\Backup Projects.ffs_batch"
if not %errorlevel% == 0 (
::if the return code is 1 or greater, something went wrong:
echo Errors occurred during synchronization...
pause & exit 1
)
Note
If you're running the batch job unattended, ensure that your script is not blocked by a notification dialog. Consider the
following options when setting up the FreeFileSync batch job:
- Enable Auto-Close to skip the summary dialog after synchronization.
- Set up error handling to Ignore errors or Cancel to stop the synchronization at the first error.
2. Start a FreeFileSync GUI configuration
If you pass a
.ffs_gui configuration file, FreeFileSync starts in GUI mode and immediately begins comparison (but only if all directories exist):
FreeFileSync.exe "D:\Manual Backup.ffs_gui"
3. Customize an existing configuration
You can replace the directories of a
.ffs_gui or
.ffs_batch
configuration file by using the
-DirPair parameter:
FreeFileSync.exe "D:\Manual Backup.ffs_gui" -dirpair C:\NewSource D:\NewTarget
4. Merge multiple configurations
When more than one configuration file is provided, FreeFileSync merges
everything into a single configuration with multiple folder pairs and start in GUI mode:
FreeFileSync.exe "D:\Manual Backup.ffs_gui" "D:\Backup Projects.ffs_batch"
5. Use a different GlobalSettings.xml file
By default, FreeFileSync uses a single GlobalSettings.xml file containing options that apply to all synchronization tasks;
for examples, see
Expert Settings.
If you want FreeFileSync to use a different settings file instead, just add the file path via command line:
FreeFileSync.exe "D:\Different GlobalSettings.xml"
Comparison Settings
Comparison Variants
FreeFileSync compares two folders by analyzing the
relative paths of the files they contain, i.e.
the paths relative to the base folder pair.
If the relative path matches, FreeFileSync decides how the file pair is categorized by considering the selected comparison variant:
1. Compare by File Time and Size
This variant considers two files equal when both
modification time and file size match.
It should be selected when synchronizing files with a backup location.
Whenever a file is changed, its file modification time is automatically updated.
Therefore, a comparison by
file time and size will detect all files that should be synchronized.
The following categories are distinguished:
- file exists on one side only
- file exists on both sides
- different date
- same date
- equal
- conflict (same date, different size)
2. Compare by File Content
Two files are marked as equal if they have
identical content.
This variant should be selected when doing consistency checks to see if the files on both sides are bit-wise identical.
This is the slowest of all comparison variants, so its usefulness for synchronization is limited.
If used for synchronization, it can serve as a fallback when modification times are not reliable.
For example certain mobile phones and legacy FTP servers do not preserve modification times,
so when file sizes match, the only reliable way to detect differences is to compare the actual content.
- file exists on one side only
- file exists on both sides
3. Compare by File size
Two files are considered equal if they have the
same file size.
Since it's possible for files that have the same size to have different content, this variant should only be used when file modification times are not
available or reliable, e.g. in certain MTP and FTP synchronization scenarios, and where a comparison by content would be too slow.
- file exists on one side only
- file exists on both sides
Symbolic Link Handling
FreeFileSync lets you include symbolic links (also called symlinks or soft links)
when scanning directories instead of skipping them. When included, you can select between two ways to handle them:
- Follow:
Treat symbolic links like the object they are pointing to. Links
pointing to directories are traversed like ordinary directories, and
the target of each link is copied during synchronization.
- As link:
Include the symbolic link object directly. Symbolic links will be shown as separate entities.
Links pointing to directories are not traversed and the link object itself
is copied during synchronization.
Note
- FreeFileSync considers the following as "symbolic links":
– file system symbolic links
– volume mount points (NTFS)
– junction points (NTFS)
– WSL symlinks (Windows Subsystem for Linux)
– Google Drive shortcuts
- Windows: Copying symbolic links requires that FreeFileSync is started with administrator rights.
Daylight Saving Time (Windows)
Synchronization software often encounters ±1-hour shifts in file times after a Daylight Saving Time (DST) change.
This typically happens when comparing a FAT32 or exFAT volume (referred to as "FAT")
with an NTFS volume, such as when synchronizing a USB stick with a local disk.
Files that were previously in sync are now shown as offset by one hour, even though they have not been modified.
This occurs because NTFS stores file times in UTC format, while FAT stores them in local time.
When comparing times from these two formats, one must be converted to the other.
Windows uses the current DST status and time zone for these calculations.
As a result, the comparison is affected by current system settings,
causing file times that were once the same to appear different after a DST change or time zone switch.
For more details on handling DST shifts in file times, see:
Beating the Daylight Saving Time Bug
Solutions:
- In FreeFileSync's comparison settings, you can enter one or more time shifts to ignore during comparison:
To handle daylight saving time differences, enter a single one-hour shift.
If the differences are caused by changing the time zone, enter one or more time shifts as needed.