How can I separate real time monitor from storing data on file??
You need to explain what this means. Do you want to average temperature data and humidity for 10 minutes and then write? Or, do you just want to write the current data once every 10 minutes?
delay(600000);
So much for real-time monitoring. The blink without delay example shows how not to bury your head in the sand for any length of time.