groovy method to write status file