Wake up Arduino Uno from sleep mode by RTC

I intend to make the device runs about couple hours a day(let say 2hrs) → go to deep sleep → wake up in next 7 days → repeat the process.

At the moment, I can able to make the device wake up every 10 seconds → flashing LED one → back to sleep → repeat the process.

My question is how to make the LED flashes for certain amount of time. For example when the now.minute <30. After that the device should go to sleep again and wait for the next alarm triggered.

I try to put that condition in the while loop, but the device only sleep for first 10s and wake up to flashing LED. It never break the while loop even the now.minute >30.

Also posted at: https://arduino.stackexchange.com/q/43124

Sorry, I did not realize it is related forum. Anyway, I got the solution. Thank you :)