This project will show you how to keep two folders in syn so one is a direct copy of the other. Ideal for backing up work both locally, to a cloud / network server or a USB drive.

There are few steps to follow :

Step 1: Installing Python and Dependencies

You have to install python on your computer or laptop. You will need to install python 3.5 or lower on your system to install module pyinstaller. Follow the web link here https://www.python.org/downloads/ and scroll down until you find the version you want.

Open the command prompt in windows or terminal in Linux and type the following :

pip install pyinstaller

pip install dirsync


Step 2: The Python Script

 The script is nice and simple, only two lines. Enter the script in your python idle or any other editor like sublime text 3 or pycharm and save as "DirectorySync.py".

from dirsync import sync

sync('C:\\FOLDER_A','E:\\FOLDER_B','sync',purge=True)

Make sure to change the two folders above with the two folders you wish to sync. The double backslash is required in the path name as the backlash is an escape character in Python.
Step 3 : Creating .exe


To create the executable we now need to move back to the command prompt.

Type the following replacing the folder path with the route to the DirectorySync.py script we create the last step:

pyinstaller -F -w C:/Route_to_your_folder/DirectorySync.py