FreeFileSync 一款开源的文件同步软件

FreeFileSync 用户手册:

FreeFileSync #快速开始

— —

Basic Usage:

  1. Choose left and right folders.
    Choose left and right directories
     
  2. Compare them.
    Start comparison
     
  3. Select synchronization settings.
    Select synchronization settings
     
  4. Press Synchronize to begin synchronization.
    Press Synchronize to begin synchronization
     
Note
For more detailed explanations on how to set up the most common synchronization scenarios, have a look at the FreeFileSync video tutorials.

Main Dialog Overview

FreeFileSync main window
  1. Change 文件对比设定
  2. Start comparison
  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

命令行使用 Usage

FreeFileSync supports additional synchronization scenarios via a 命令行使用 interface. To get a syntax overview, open the console, go to the directory where FreeFileSync is installed and type:
FreeFileSync -h or FreeFileSync --help

命令行使用 syntax

1. Run a FreeFileSync batch job

In order to start synchronization in batch mode, supply the path of a ffs_batch configuration file as the first argument after the FreeFileSync executable:
FreeFileSync "D:\Backup Projects.ffs_batch"

After synchronization one of the following status codes is returned:
Exit Codes
0   Synchronization completed successfully
1   Synchronization completed with warnings
2   Synchronization completed with errors
3   Synchronization was aborted

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 not %errorlevel% == 0 (
  ::if return code is 1 or greater, something went wrong, add special treatment here
  echo Errors occurred during synchronization...
  pause & exit 1
)

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:
 
  • 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 file, FreeFileSync will start in GUI mode and immediately start comparison (but only if all directories exist):
FreeFileSync "D:\Manual Backup.ffs_gui"

3. Customize an existing configuration

You can replace the directories of a given ffs_gui or ffs_batch configuration file by using the -DirPair parameter:
FreeFileSync "D:\Manual Backup.ffs_gui" -dirpair C:\NewSource D:\NewTarget

4. Merge multiple configurations

When more than one configuration file is provided, FreeFileSync will merge everything into a single configuration with multiple folder pairs and start in GUI mode:
FreeFileSync "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 专业设置. If you want FreeFileSync to use a different settings file instead, just add the path via 命令行使用:
FreeFileSync "D:\Different GlobalSettings.xml"

文件对比设定

文件对比设定 dialog

Comparison Variants

When comparing two folders, FreeFileSync analyses the relative paths of the contained files. 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 also updated. Therefore, a comparison by File Time and size will detect all files that should be synchronized. The following categories are distinguished:
 
  1. file exists on one side only
    • left only
    • right only
  2. file exists on both sides
    1. different date
      • left newer
      • right newer
    2. 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. Naturally, it is the slowest of all comparison variants, so its usefulness for the purpose of 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 the only way to detect different files when the file sizes are the same is by reading their content.
 
  1. file exists on one side only
    • left only
    • right only
  2. file exists on both sides
    • equal
    • different content

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.
 
  1. file exists on one side only
    • left only
    • right only
  2. file exists on both sides
    • equal
    • different size

Symbolic Link Handling

FreeFileSync lets you choose to include symbolic links (also called symlinks or soft links) when scanning directories rather than skipping over them. When included, you can select between two ways to handle them:
 
  1. 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.
     
  2. 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 items as "symbolic links":
    – file system symbolic links
    – volume mount points (NTFS)
    – junction points (NTFS)
    – WSL symlinks
    – Google Drive shortcuts
  • Windows: Copying symbolic links requires that FreeFileSync is started with administrator rights.

夏令时设置 (Windows)

A common problem synchronization software has to handle is +-1 hour file time shifts after a 夏令时设置 (DST) switch has occurred. This can be observed, for example, when a FAT32- or exFAT-formatted volume (in the following called "FAT") is compared against an NTFS volume, like when synchronizing a USB memory stick against a local disk. Files that previously appeared to be in sync are now shown with a one hour modification time offset, although they have not been modified by the user or the operating system.

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.

For a detailed discussion about this issue see:
https://www.codeproject.com/Articles/1144/Beating-the-Daylight-Savings-Time-bug

Solutions:

  1. In FreeFileSync's 文件对比设定 you can enter one or more time shifts to ignore during comparison: If you need to handle differences due to 夏令时设置, enter a single one hour shift. If the differences are caused by changing the time zone, enter one or more time shifts as needed.
    Ignore 夏令时设置 shift

    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.

排除文件(夹) and Folders via Filter

File exclude filter

Files and folders 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 filter item must be a file or folder path relative to the selected folder pair.
  • Multiple items must be separated by | or a new line.
  • Wild cards may be used:  
    * means zero or more characters
    ? represents exactly one character
    ?* matches one or more characters
  • Filter matching is case-insensitive

Example: Match items of a folder pair

The following filter phrases assume a folder pair C:\Source <—> D:\Target and can be used for the include as well as exclude filter.
 
Description Filter phrase
Single file (or folder) C:\Source\file.txt \file.txt
Single folder C:\Source\SubFolder \SubFolder\
All files (and folders) named thumbs.db *\thumbs.db
All files (and folders) starting with the Z character *\z*
All *.tmp files (and folders) in C:\Source\SubFolder \SubFolder\*.tmp
Files and folders containing temp in their path *temp*
Multiple entries (separated by vertical bar) *.tmp | *.doc | *.bak
All subfolders of the folder pair *\
Files/folders inside subfolders of the folder pair ?*\?*
All files (but not folders) *:

Example: Complex filter rules with exceptions

Complex filter requirements can often be solved by using two folder pairs with the same source and target paths but different local filter. The first folder pair handles the default case. The second folder pair the exception.
 
Exclude a sub folder except for *.txt files by using two folder pairs:
C:\Source <—> D:\Target     local exclude filter: \SubFolder\
C:\Source <—> D:\Target     local include filter: \SubFolder\*.txt

Example: Exclude empty folders

Set *: as include filter to match all files, but not folders. During synchronization some excluded folders will still be created if needed, but only if they contain at least one non-excluded item, that is, when they are not empty.

Note
  • For simple exclusions: Instead of typing the filter phrase manually, go the the FreeFileSync main window, right-click one or more files from the list, and exclude via the context menu.
  • A filter phrase can match both file and folder paths by default. To match only one of them, you can give a hint:
    1. Files only: append a colon (:)
    2. Folders only: append a path separator (/ or \)
  • If the filter is matching a folder, all its files and subfolders are also (implicitly) matched. Thus the filter phrases SubFolder\ and SubFolder\* are synonymous.
  • Both slash (/) and backslash (\) can be used as the path separator character.

专业设置

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

<?xml version="1.0" encoding="UTF-8"?>
<FreeFileSync XmlType="GLOBAL">
    <General>
        <FileTimeTolerance Seconds="2"/>
        <RunWithBackgroundPriority Enabled="false"/>
        <LockDirectoriesDuringSync Enabled="true"/>
        <VerifyCopiedFiles Enabled="false"/>
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 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?

调用外部程序

When you double-click on one of the rows on the main dialog, FreeFileSync opens the operating system's file browser by default:
Windows:explorer.exe /select, "%local_path%" & exit 0
macOS: open -R "%local_path%"
Linux: xdg-open "$(dirname "%local_path%")"
To customize this behavior, or integrate other 调用外部程序 into FreeFileSync, navigate to Menu → Tools → Options → Customize context menu and add or replace a command.

All entries can be accessed quickly by pressing the associated numeric keys 0–9 or via the context menu that is shown after a right mouse click. The first entry can also be executed by double-clicking on an item.

In addition to regular Macros, the following special macros are available:
Macro Description
%item_path%
Full file or folder path
%local_path%
Creates a temporary local copy for files located on SFTP and MTP storage. Otherwise identical to %item_path% for local files and network shares.
%item_name%
File or folder name
%parent_path%
Parent folder path

  • To refer to the item on the opposite side, append "2" to the macro name:
    %item_path2%, %local_path2%, %item_name2%, %parent_path2%.
  • To generate a list including all selected items (separated by space), append "s" to the macro name:
    %item_paths%, %local_paths%, %item_names%, %parent_paths%.

Examples:

  • Start a file content comparison tool (WinMerge):
    "C:\Program Files (x86)\WinMerge\WinMergeU.exe" "%local_path%" "%local_path2%"

    opendiff on macOS (requires Xcode):
    opendiff "%local_path%" "%local_path2%"

  • Show file in Windows Explorer:
    explorer.exe /select, "%local_path%" & exit 0
    Note
    Explorer.exe does not set an exit code, but FreeFileSync will show an error message if it does not find exit code = 0 ("Success"). To mitigate, append (&) command exit 0 to set the exit code explicitly.

  • Open command prompt for the selected item:
    start cmd.exe /k cd /D "%parent_path%"
    Note
    FreeFileSync hides the console window, so start opens a new window. cmd.exe /k runs the following command without immediately exiting the console. cd navigates to the directory, even if it's on a different volume (/D).

  • Copy item path to Clipboard (as alternative to CTRL + C)
    echo %item_path%| clip

  • Write list of selected file paths to a text file:
    echo %item_path% >> %csidl_Desktop%\file_list.txt

  • Preview files using Quick Look on macOS:
    qlmanage -p "%local_path%"

  • Pass a list of selected files to a script as 命令行使用 arguments:
    C:\my-script.cmd "%local_paths%"

Note
Macros need to be protected with quotation marks if they resolve to file paths that could contain 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.

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]
%MonthName% Dec short name
%Day% 31 [01–31]
 
%Hour% 11 [00–23]
%Min% 22 [00–59]
%Sec% 33 [00–59]
 
%WeekDay% 1 [1–7]
%WeekDayName% Mon short name
%Week% 52      [01–52] calendar week

Environment Variables (Windows)

Macro Example
%AllUsersProfile% C:\ProgramData
%AppData% C:\Users\Zenju\AppData\Roaming
%ComputerName% Zenju-PC
%LocalAppData% C:\Users\Zenju\AppData\Local
%ProgramData% C:\ProgramData
%ProgramFiles% C:\Program Files
%ProgramFiles(x86)% C:\Program Files (x86)
%Public% C:\Users\Public
%Temp% C:\Windows\Temp
%UserName% Zenju
%UserProfile% C:\Users\Zenju
%WinDir% C:\Windows

Special Folder Locations (Windows)

Macro Example
%csidl_Desktop% C:\Users\Zenju\Desktop
%csidl_Documents% C:\Users\Zenju\Documents
%csidl_Pictures% C:\Users\Zenju\Pictures
%csidl_Music% C:\Users\Zenju\Music
%csidl_Videos% C:\Users\Zenju\Videos
%csidl_Downloads% C:\Users\Zenju\Downloads
%csidl_Favorites% C:\Users\Zenju\Favorites
%csidl_Resources% C:\Windows\Resources
%csidl_QuickLaunch% C:\Users\Zenju\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch
%csidl_StartMenu% C:\Users\Zenju\AppData\Roaming\Microsoft\Windows\Start Menu
%csidl_Programs% C:\Users\Zenju\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
%csidl_Startup% C:\Users\Zenju\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\StartUp
%csidl_Nethood% C:\Users\Zenju\AppData\Roaming\Microsoft\Windows\Network Shortcuts
%csidl_Templates% C:\Users\Zenju\AppData\Roaming\Microsoft\Windows\Templates
 

Note: Most of the macros above have a variant for public folders, e.g. %csidl_Documents% has %csidl_PublicDocuments%.


Hint: You can add 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:

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

Performance settings 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 FTP server enforcing 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 文件对比设定 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:
    C:\Source D:\Target
    C:\Source2 E:\Target
    Device root Parallel operations
    C:\ 1
    D:\ 2
    E:\ 3
    FreeFileSync will put the folders C:\Source and C:\Source2 into the same group and allow only 1 file operation at a time. Folder D:\Target will be traversed using 2 operations, and E:\Target using 3 operations at a time. In total FreeFileSync will be scanning all four folders employing 6 file operations in parallel.

  • 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:\SourceD:\Target will be synchronized using 2 parallel operations, and C:\Source2E:\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.

RealTimeSync RealTimeSync

— Automated Synchronization —

The function of RealTimeSync is to execute a 命令行使用 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 命令行使用 will trigger a FreeFileSync batch job.

RealTimeSync receives 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 waits until a user-configurable idle time has passed in which no further changes were detected, and then runs the 命令行使用. This makes sure the monitored folders are not in heavy use when starting a synchronization.

Example: Real time synchronization using FreeFileSync

Start RealTimeSync.exe located in FreeFileSync's installation directory and enter the folders you want to monitor. Instead of doing this manually you can import an ffs_batch file via Menu → File → Open or simply via drag and drop. RealTimeSync will not only extract all directories relevant for synchronization, but will also set up the 命令行使用 to execute the ffs_batch file each time changes are detected. Now press Start to begin monitoring.
RealTimeSync main window
 
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 命令行使用 Usage.
  • RealTimeSync will skip showing the main dialog and begin monitoring immediately if you pass an ffs_real configuration file as the first 命令行使用 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"
  • You can also pass an ffs_batch file as first argument, which RealTimeSync will automatically convert into a ffs_real configuration with default settings (e.g. 10 seconds idle time).
  • RealTimeSync does not require you to start FreeFileSync. It can also be used in other scenarios, like sending an email whenever a certain directory is modified.

Example: Automatic synchronization when a USB stick is inserted

Save an ffs_batch configuration in the USB stick's root directory, e.g. H:\ and let FreeFileSync run it when the stick is mounted. But, instead of hard coding the USB drive letter H:\ (which may change occasionally), refer to the USB stick via its volume name instead.

Configure RealTimeSync as follows:
 
Monitor USB stick insert
"Backup" is the volume name of the USB stick in our example.


Whenever directory H:\Data becomes available, RealTimeSync executes the 命令行使用 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%.
They are only visible for the 命令行使用 that RealTimeSync is executing.

Example: Log names of changed files and directories

Write a list of all changes to a log file: (Windows)
echo %change_action% %change_path% >> %csidl_Desktop%\log.txt

Write a list of all changes to a log file: (Linux/macOS)
echo $change_action $change_path >> ~/Desktop/log.txt

Limitations:

  • If multiple changes happen at the same time, only the path of the first file is written to variable %change_path%.

  • While RealTimeSync is executing the 命令行使用, monitoring for changed files is temporarily inactive.

  • RealTimeSync relies on receiving change notifications from the operating system. In some cases it just doesn't receive any, e.g. a network path with badly-written/incomplete driver implementation. These buggy drivers often do not fail with an error code, but just do nothing.

The 命令行使用 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 命令行使用 only after the user-specified idle time has passed. In any case, files changed during the execution of FreeFileSync will be synchronized the next time FreeFileSync runs.

RealTimeSync: Run as Service (Windows)

RealTimeSync is designed to run as a background process which does not need further attention. Depending on your requirements, there are a number of ways to start it automatically. Generally, the goal is to execute a 命令行使用 of the form:
<FreeFileSync installation folder>\RealTimeSync.exe <path to *.ffs_real or *.ffs_batch file>
e.g.:
"C:\Program Files\FreeFileSync\RealTimeSync.exe" "D:\Backup Projects.ffs_real"

Example: Run RealTimeSync on Windows login

Create a new shortcut, enter the 命令行使用 from above as target and place it into the Windows autostart folder. (Enter shell:startup in the Windows Explorer address bar to find the folder quickly.)

Create shortcut

Shortcut properties

Example: Start RealTimeSync as a Service

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 命令行使用 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.

Schedule RealTimeSync

Schedule Batch Jobs

  1. Create a new batch job via FreeFileSync's main dialog: Menu → File → Save as a batch job...
    Setup a FreeFileSync batch job

  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.
     
  4. The FreeFileSync batch job can be started by double-clicking on the ffs_batch file or it can be set up in your operating system's scheduler:
     

Note
Be sure to enable Auto-Close and Ignore errors/Cancel if you schedule the ffs_batch file to run under a different user account. With no one there to close the results dialog manually, the task would hang indefinitely.



Windows Task Scheduler

  1. Open the Task Scheduler either via the start menu, or enter taskschd.msc in the run dialog (keyboard shortcut: Windows + R).
     
  2. Create a new basic task and follow the wizard.
     
  3. Make Program/script point to the location of FreeFileSync.exe and insert the ffs_batch file into Add arguments.
     
  4. Use quotation marks to protect spaces in path names, e.g. "D:\Backup Projects.ffs_batch"
    Windows Task Scheduler

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 the configuration file GlobalSettings.xml will also be read from a different path, C:\Users\<username>\AppData\Roaming\FreeFileSync, or in the case of the SYSTEM account from C:\Windows\System32\config\systemprofile\AppData\Roaming\FreeFileSync.
    You can force usage of a particular GlobalSettings.xml file by passing it as a 命令行使用 parameter.



macOS Automator and Calendar

  1. Open Launchpad and run Automator.
    Launch macOS Automator
     
  2. Create a new Calendar Alarm.
    Create Calendar Alarm
     
  3. Drag and drop the ffs_batch file on the workflow panel.
    Drop FreeFileSync batch file in Automator
     
  4. Drag and drop action Files & Folders/Open Finder Items and add it to the workflow.
    Add open Finder items
     
  5. Go to File → Save... and save the Automator job.
    Save Automator job
     
  6. 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.
    Edit batch job in Calendar



Ubuntu Linux Gnome Scheduled Tasks

  1. Install Gnome-schedule if necessary: sudo apt-get install gnome-schedule
     
  2. Search the Ubuntu Unity Dash for Scheduled tasks
     
  3. Enter the command: <FreeFileSync installation folder>/FreeFileSync <job name>.ffs_batch
     
  4. Select X application since FreeFileSync requires access to GUI
    Gnome Scheduler

Synchronization Settings

Synchronization settings dialog

Synchronization Variants

There are three basic synchronization variants:

  • If both left and right folders contain files you're working on, and you want changes (creates, updates, and deletes) to flow in both directions, then select Two way.
    Database files ("sync.ffs_db") will be created after the first sync and be used to compare the current file system state against the last synchronization in order to determine the sync directions.

  • If one folder contains your work files and the other is for backup, then select the Mirror variant.
    The left folder is the source and the right folder the target. The synchronization will create and delete files on the target as needed until it becomes an exact copy of the source.

  • If you only want to add files to your backup, but never delete, then select the Update variant.
    Files deleted on the source side will not cause file deletion on the backup drive (e.g. after you've made room for new photos on a digital camera). On the other hand, files deleted on the backup drive will not be copied over a second time (e.g. after you have removed photos you don't want to keep).

In order to handle special synchronization scenarios you can also set up Custom rules. These can either be based on the categories determined after folder comparison (left/right only, left/right newer), or on detected changes (create, update, delete) if you select Use database file to detect changes.

Detect Moved Files

FreeFileSync is able to detect moved files and quickly apply the same move on the target side during synchronization instead of a slow copy and delete. To makes this work, Use database file to detect changes must be checked and the file system must support file IDs.

Note
  • Detection of moved files is not yet possible when synchronizing a folder pair for the first time. Only beginning with the second sync the database files are available to determine moved files.
  • Detection is not supported on file systems that don't have (stable) file IDs. Most notably, certain file moves on FAT file systems cannot be detected. Also, protocols like SFTP do not support move detection. In these cases FreeFileSync will automatically fall back to "copy and delete".

SFTP and FTP Setup

FreeFileSync supports synchronization with SFTP and FTP natively. Just enter your login information into the dialog shown for cloud folder selection: Cloud folder button
 
Enter SFTP login data

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.

Configure SFTP for Best Performance

By default, FreeFileSync creates one connection to the server and uses one SFTP channel, i.e. only a single SFTP command can be sent and received at a time. Since most of this time is spent waiting due to the high latency of the remote connection, you can speed up reading large folder hierarchies by increasing both the connection and channel count.

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.
 
Set up SFTP for best performance
 
  • 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.
     
  • Enable compression to improve performance if the connection to the SFTP server is slow and the data is mostly uncompressed (e.g. copying text files over a slow internet connection). However, if the connection is very fast (e.g. a local network), or the data is already compressed (e.g. zip files), the CPU overhead of the zlib compression algorithm might slow transfer times down and the option is better left unchecked.

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.

Tips and Tricks

Change settings with a single mouse click: Press and hold the right mouse button until the context menu is shown, then release while over the selection: 文件对比设定 context menu Filter context menu Synchronization settings context menu
Select multiple configurations at a time: Select multiple configurations Select multiple items via mouse, and refine the selection by holding the Control key while clicking.
Start comparison directly by double-clicking on a configuration: Double-click on configuration
Run a partial synchronization only for the currently selected files: Synchronize Selection
Synchronize multiple folder pairs at a time with different configurations: Add folder pair
Start synchronization directly without clicking on compare first: Start synchronization directly
Move a window by clicking on a free area and holding the mouse button: Move dialog via mouse
Open a batch configuration for edit via the Windows Explorer context menu: Explorer context menu
Drag and drop two folders at a time from Windows Explorer to fill a folder pair in one go: Two-folder drop
Copy files selected on the main dialog to an alternate folder and thereby save a "diff": Copy to alternative path
Use a volume name instead of a drive letter: Drive letter by volume name
Show thumbnail icons via the column header context menu: Show thumbnail icons
Save the current view filter selection as default: Save view filter settings
Remove local settings from individual folder pairs: Remove local settings
Remove obsolete paths from the folder drop-down by using mouse hover and Delete key: Remove drop-down path
Select a time span for files to include via the date column context menu: Select time span
Double-click on comparison and synchronization variants to confirm the dialog: Double-click comparison variant Double-click synchronization variant
Select multiple files and rename all of them in one go (via context menu or F2 key): File rename dialog

Variable Drive Letters

USB memory sticks or external hard disks often get different drive letters assigned than the last time when they were plugged into the computer. FreeFileSync offers the following solutions:

Option 1: Specify a path by using a unique volume name instead of a drive letter:
E.g. [Backup-Disk]\folder
replaces E:\folder when the name of the USB stick in drive E:\ is "Backup-Disk".
You can change a volume name by right-clicking on the drive letter in Windows Explorer and selecting Rename.

Option 2: Refer to a disk volume by its unique GUID:
E.g. \\?\Volume{01234567-89ab-cdef-0123-456789abcdef}\folder
A volume GUID uniquely identifies a particular drive partition and will not change over time. To get an overview of all volume GUIDs for mounted drives on the system you can run the mountvol 命令行使用 tool.
 

Note
It is not required to look up and enter a volume name, volume guid or macro manually. Simply select an alternative path from the drop down menu:
Drive letter by volume name

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.

1. Keep only the most recent versions

In synchronization settings, set deletion handling to Versioning and naming convention to Replace. Deleted files will be moved to the specified folder without any decoration and will replace already existing older versions.
Versioning

2. Keep multiple versions of old files

  1. Set deletion handling to Versioning and naming convention to Time stamp [File]. FreeFileSync will move deleted files into the provided folder and add a time stamp to each file name. The structure of the synchronized folders is preserved so that old versions of a file can be conveniently accessed via a file browser.
     
    Example: Last versions of the file Folder\File.txt inside folder D:\Revisions
    D:\Revisions\Folder\File.txt 2020-12-11 111111.txt
    D:\Revisions\Folder\File.txt 2020-12-12 122222.txt
    D:\Revisions\Folder\File.txt 2020-12-13 133333.txt

  2. 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
    D:\Revisions\2020-12-11 111111\Folder\File.txt
    D:\Revisions\2020-12-12 122222\Folder\File.txt
    D:\Revisions\2020-12-13 133333\Folder\File.txt

3. Save versions at certain intervals

With naming convention Replace it is possible to refine the granularity of versions to keep by adding Macros to the versioning folder path. For example, you can save deleted files on a daily basis by adding the %date% macro:

Example: Last versions of the file Folder\File.txt inside folder D:\Revisions\%date%
D:\Revisions\2020-12-11\Folder\File.txt
D:\Revisions\2020-12-12\Folder\File.txt
D:\Revisions\2020-12-13\Folder\File.txt

Volume Shadow Copy (Windows only)

FreeFileSync supports copying locked or shared files by creating a Volume Shadow Copy of the source drive. This feature can be configured via Menu → Tools → Options: Copy locked files.

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.