write to file every minute