Write history every 30 seconds