aggregate script for update and snapshot