modified runonce to only touch DB if mysql command ran successfully