The simplest way is to synchronize the clock of the Pi with your RTC and simply use cron
. Depending on how much your pi diverges, you can sync the clock of the pi from time to time in cron
too.
Typically, that would look like :
#M H dom mon dow cmd
0 * * * * rtc-pi
0 12 * * * script_to_turn_on
5 12 * * * script_to_turn_off
--- addition---
For those that have a DS1302, it may be obvious that rtc-pi
is the program that interfaces with the DS1302 module. It is not in the standard repositories, but can be obtained from (among others) https://zedt.eu/storage/2014/07/rtc-pi-20140727.zip
. For other versions of the RTC (like the DS1307) the command would be hwclock
, which can be downloaded from https://github.com/Seeed-Studio/pi-hats.git