Write sync script