Running Sync in configuration mode enables you to apply pre-configured parameters at the program start. This can be very helpful if you need to apply the same settings on a number of different machines. The instructions below will guide you through the process of creating and using configuration file on Linux, Windows and OS X.
1. Get a sample configuration file by executing:
./rslsync --dump-sample-config > sync.conf
Once that is done, file sync.conf will be created in the current directory. Alternatively, you can download a sample config file here
2. Open the file in a text editor and adjust the parameters the way you need.
3. Save the file and run Sync in config mode is as follows:
./rslsync --config /path/to/sync.conf
Now Sync will be launched with the configured settings.
WINDOWS1. Download sample configuration file from here.
2. Open the config file in Notepad and set up your preferred values.
3. Save the file as sync.conf in the storage folder. Start Sync.
4. Other options is to launch Sync with /config parameter:
- either open Command Line Interface, navigate to the folder where exe is located, and execute the following command:
"Resilio Sync.exe" /config sync.conf
- or add /config C:\path\to\sync.conf parameter into shortcut's preferences.
- If you set up a non-default "storage_path" in config, new setting will be created there.
- To launch Sync Service in config more, just put it to the service's storage. Other options mentioned here will not work with the service.
MAC OS X
1. Download sample configuration file from here.
2. Open it in a plain text editor (don't use Text Edit app!) and set up your preferred values. Save the file as sync.conf and save in storage folder.
3. Another option is to open Terminal and run Sync in config mode with the following command:
Now Sync will be launched with the configured settings
Sample configuration file overview:
Note, that in config mode you can set up only Standard folders, not Advanced. Config file is a json format, so it's advisable to run it through any json syntax validator. When editing any paths in config file use slash for Linux and OS X, and double back slash in full path for Windows.
Wherever there is true/false option, "true" stands for "enable, or ON", "false" stands for "disable, or OFF". Uncomment the wanted parameters and leave the unwanted ones commented or remove them at all.
Set device name and listening port.
If the value is set to "0", a random port number will be allocated.
Set storage path directory - the directory where Sync will be storing its settings, debug logs and identity details. If no storage path is entered, .sync storage folder will be created in the same directory from where binary is launched.
Set location of the process id file. if not specified the sync.pid file will be created in storage folder.
If "true" is selected, Sync will send UPnP and NAT-PMP packets to the router, trying to map ports automatically.
Allows you to limit the bandwidth used by Sync. By default the limits apply only to the internet connections, not to LAN.
"0" stands for "no limit".
Set proxy configuration
"proxy_type": set proxy types. Valid types are "socks4", "socks5", "http_connect", any other value means no proxy.
"proxy_addr" - IP address of proxy server.
"proxy_port" - define proxy port.
"proxy_auth" - authentication for proxy. Only username/password for socks5 is supported.
"proxy_username" - set proxy username.
"proxy_password" - set proxy password.
Directory_root_policy defines how directory_root is used (Linux only).
Valid values are:
"all" accepts directory_root and its subdirectories for 'getdir' and 'adddir' actions
"belowroot" accepts directory_root's subdirectories for 'getdir' and 'adddir' actions
but denies attempts to use 'adddir' to create directories directly within directory_root
Default value is "all".
"listen" : <IP: port>
For example, 0.0.0.0:8888 will listen to any interface on the LAN at port 8888.
To disable WebUI, remove this field
"Login" and "Password" - allow you to set credentials.
"password_hash" - allows you to enter password hash in crypt(3) format. Works only for UNIX systems.
"password_hash_unified" - allows you to enter password hash in HEX format. Can be used on all platforms.
"password_hash_salt_unified" - can be used on all plaforms.
"allow_empty_password" - if no password or password hash is specified, empty password is allowed.
"force_https" - if "true" is selected, http will be disabled.
"ssl_certificate" - set path to ssl certificate.
"ssl_private_key" - set path to private key.
"dir_whitelist" - defined the directories that can be used to store sync shares. Others will not be visible in folder picker.
Shared folders section:
If you set shared folders in config file WebUI will be DISABLED. Shared directories specified in configuration file override the folders previously added from WebUI.
"secret" - use --generate-secret in command line to create new secret
"dir" - edit path to folder
"use_relay_server" - "true" - relay server will be used when connection fails. False = "use_relay_server" is disabled.
"search_lan" - if "true" is selected, Sync will search your local network for other instances of Sync having the same Keys as yours. The fastest way to discover other peers in LAN. If you choose to disable this option, either make sure that the use of Tracker server is allowed or configure predefined hosts.
"use_sync_trash" - "true" enables SyncArchive to store files deleted on remote devices.
"overwrite changes" - "true" restores modified files to original version (only for read-only version).
"selective_sync" - adding folder in selective sync mode.
"known hosts" - specify hosts to attempt connection without additional search.
Note that parameters from Advanced Preferences can also be added to configuration file.