mkdir-based sync algorithm