The Folder Synchronization Script is a Python script that allows you to synchronize the contents of two folders on macOS. It compares the files and subfolders between the source folder and the target folder, and performs the necessary operations to make the two folders identical.
-
Ensure that you have Python installed on your macOS system.
-
Download or clone the script to your local machine.
-
Open a terminal and navigate to the directory where the script is located.
-
Run the script using the following command, providing the paths to the source and target folders:
python sync_folders.py -s /path/to/source/folder -d /path/to/target/folder
Replace
/path/to/source/folder
with the actual path to your source folder, and/path/to/target/folder
with the actual path to your target folder.Note: The target folder will be created if it doesn't exist.
-
The script will compare the contents of the source and target folders and perform the necessary operations to synchronize them. It will copy missing files and subfolders from the source folder to the target folder, and remove files and subfolders from the target folder that are not present in the source folder.
-
The script will display the actions performed during the synchronization process in the terminal.
Make sure to backup your data before running the script, as it can modify and delete files and folders. Use the script at your own risk.
- Python 3.x
This script is provided under the MIT License. See the LICENSE file for more information.