mpy_sync

mpy_sync.sync(src, dest, cleanup=True)

Generator which syncs a source-folder to a destination folder. Copies files where the modification date is newer then the last sync date. Last sync date is saved in .last_sync-file stored in the source-folder. Optional deletes files from destination folder if not existend in source folder.

Can be configured with a ini-like .mpy_sync file in the source directory.

param src:source-folder
param dest:destination-folder
param cleanup:If true, files not existing in the source folder gets deleted form the destination folder (optional)
return:yields sync operations e.g. FileCreated, FileDeleted, FileUpdated, DirectoryCreated, DirectoryDeleted
for f in sync('myporject/src', '/mnt/mpy_fs', cleanup=True):
    print(f)
[last_sync] # internals - do not modify this section
123456.99

[ignore] # File/Directory pattern to ignore over whole synchronisation process
.git*

[ignore.sync] # File/Directory pattern ignored at copiing files to the board
test

[ignore.delete] # File/Directoy pattern ignored at deleting from the board
boot.py
main.py