Here’s a simple Python script that can auto-sync two folders by copying new or changed files from a source folder to a destination folder. It uses the filecmp
and shutil
modules to compare and copy files, and can be run periodically or as a continuous sync if you want.
How it works:
-
Compares source and destination folders.
-
Copies new or updated files/folders from source to destination.
-
Removes files/folders from destination that are no longer in source.
-
Supports recursive syncing of subdirectories.
Change the source_folder
and destination_folder
variables to your paths and run the script. You can uncomment the loop for continuous syncing with a delay.
Let me know if you want it adapted to other languages or with extra features!
Leave a Reply