In order to setup a chronological repeating task without a for loop that checks every second, you will use cron library installed on most linux distros.
Managed by background Daemon Process crond
Setups
crontab -eornvim /etc/crontab- https://crontab.guru find the time that you want to repeat.
- Write your task:
* */5 * * * /sbin/shutdown -r now(will reboot every 5hrs) - After saving, cron will update right away, no extra steps required.
crontab -lto view saved tasks
Cron Job Location
/var/spool/cron/crontabs
/etc/crontab