FreeFileSync Open Source File Synchronization

About Tutorials Screenshots Vision Download Archive Forum F.A.Q. Manual Donate
It looks like an ad blocker has blocked the ads. Donate now The FreeFileSync project is 100% dependent on ad revenue and donations to stay alive. Instead of the ads, and after FreeFileSync has proven useful to you, please think about supporting with a donation.
FreeFileSync User Manual:

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

Command line 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.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.

For a simple test 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 run the batch job unattended, make sure 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"