all: implement logic from new sync

Implement logic for new sync without main function.
Logic implies sync only updated files with database.
Check is not reasy yet.