Write snapshot script