How to make temp data logging and seding time different?

Hi all.

I made temp and humidity data logger in which those data check temp and humidity every 5 mins and send them to the ThingSpeak server every 5 mins, and the logger turns into deepsleep mode.

  • Nodemcu+DHT22+MLX90614+3AA batteries

But, I want it to keep working longer days.
Indeed, the issue is to make logging and seding data time different.

ex) Logging data every 2 mins -> If 5 data are piled, wake ESP8266 up and send them to the server.

Could you give me any advice? (if possible, need detail codes)
Or any other ways to make it work longer.

Thank you!

just include a counter in the loop so that it only sends data every fifth trip round, the reset counter, and buffer.