Realtime saving to history file