Advertisment

Sync Files and Folders Between Two Machines

A free and open source software called Syncthing let’s you automatically sync files and folders between two machines.

author-image
Rajkumar Maurya
New Update
sync-files

A free and open source software called Syncthing let’s you automatically sync files and folders between two machines. We show you how to do it between Windows and Ubuntu based machines

Advertisment

Syncthing is an open-source file synchronization client/server application, written in Go, implementing its own, equally free Block Exchange Protocol (BEP). There are many programs capable of keeping files in sync between different computers. Syncthing is a compelling new option that is cross platform, completely open source, very flexible, and easy to use. Here we will show you how to get started using Syncthing to synchronize data between Ubuntu 14.04 server and Windows. This will allow you to seamlessly sync files between these servers based on configured ‘watch’ directories.

Prerequisites

You will need access to two or more machines. Here we are using two machines — one with Ubuntu 14.04 and the other with Window 7. These two machines equally sync or mirror files once you install and configure  Syncthing on them.

Installing/Configuring Syncthing on Ubunty 14.04

Step 1: Download Syncthing by using the following command or download it from the Syncthing website.

32bit

wget http://goo.gl/NJiShm

tar -xvf syncthing-linux-386-v0.10.1.tar.gz

cd syncthing-linux-386- v0.10.1

./syncthing

64bit

wget http://goo.gl/dwtvz9

tar -xvf syncthing-linux-amd64- v0.10.1.tar.gz

cd syncthing-linux-amd64- v0.10.1

./syncthing

Step 2: Now on your http://localhost IP:8080 you get a web based GUI interface of Syncthing.

step-3
Advertisment

Step 3: By default, the Syncthing web interface is only available to connections from the same computer. To connect it from a remote server, you need to make some changes in its configuration. Right click on the top right side Setting icon and click on Setting in its Dashboard. Go to GUI Listen Addresses and change the default ip 127.0.0.1:8080 to 0.0.0.0:8080 and save it.

step-2

Step 4: After saving the configuration, you get a pop-up command to restart. Click on the Restart button.

Advertisment

Installing Syncthing on Windows

Step 1: Just download Syncthing from their site, unzip and run the syncthing.exe file and automatically a web based GUI of Syncthing will open in your default web browser. Do the same configuration which was done in step 3.

Synchronizing Ubuntu and Windows Machines

Step 1: On the Ubuntu machine, open the Syncthing GUI and click on Setting icon -> Show ID

Step 2: Copy the ID from the above step and open Syncthing GUI on the Windows machine. Click on Add Device option and paste the copied ID in Device ID box. Also give the Device a name and enter its IP address.

Advertisment
step-4

Step 3: Repeat the same step of entering the device ID of the Windows machine into the Ubuntu machine.

Step 4: By default you will get a folder which is ready to sync the file on both the servers, but if you want to add it manually, then click on the Add Folder option, which you will find on Syncthing dashboard. Once you click on it, a pop-up window will open in which you give Folder ID - whatever you want but enter the same Folder ID/name on every machine which syncs this folder. Copy the path of the folder which you want to sync and paste it in the Folder Path box and check the share device box at bottom.

Advertisment
step-5

Step 5: After a while (up to a minute) connect to the other node and follow the step 4 in other machine, give the same Folder ID and local folder path where you want to sync file in the folder path box.

Step 6: The given screenshot is from windows machine in which folder ID is default and sync files from Ubuntu machine. But at this point the two nodes share an empty directory. Adding files to the Sync directory on either node will synchronize those files to the other side. Each node scans for changes every sixty seconds, so changes can take longer than a minute to propagate to the other side.

step-6
linux ubuntu opensource netwroking machines
Advertisment