Update sync script to do smarter updating