mar10 / pyftpsync

Synchronize directories using FTP(S), SFTP, or file system access.
https://pyftpsync.readthedocs.io
MIT License
117 stars 25 forks source link

Question about usage #72

Closed EnricoBeltramo closed 3 years ago

EnricoBeltramo commented 3 years ago

I'm looking for this library, but I have some trouble to find clear examples. I need to sync two folders in backbround. There exist a no blocking run() version of bidirectional sync? After set a source and dest to sync, is it possible to stop the sync and restart it with another couple of source and destination?

mar10 commented 3 years ago

run() is blocking see the example.

You could run it inside a separate thread, of course. There is currently no way to stop run() from an external thread, but you could implement it in a custom class that is derrived from the synchronizer and overrides _tick() for example.