V
V
Vasily Vasilyev2017-11-29 21:51:48
Python
Vasily Vasilyev, 2017-11-29 21:51:48

Algorithm for syncing multiple folders on one PC?

We have:
Two different folders on the same PC - domost, folder A:

C:../Desktop/Files
and folder B:
D:/DeskFiles

Task:
Write a program that would constantly run as a background process and synchronize both folders with any changes in any of them.
Cases:
1. Deleted a file from folder A - it was automatically deleted from folder B and vice versa.

2. Added a file to folder A - it was duplicated in folder B and vice versa

Moreover, all this should consume a minimum of PC resources (there are no restrictions on synchronization time).
So far, only comparing hash sums at intervals in a cycle comes to mind, but I'm not sure about the adequacy of this method - I practically didn’t work with hashes.
PS: maybe there are some libraries for this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2017-11-29
@Basil_Dev

https://msdn.microsoft.com/en-us/library/windows/d...
or use the inotify ports.

V
Vasily Vasilyev, 2017-11-30
@Basil_Dev

I found a curious lib for python - dirsync . Haven't checked yet, tomorrow I'll pick it up.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question