[ Reboot ] daily reboot for diet-pi !

Hey lovely ppl at Diet-Pi forum !
It’s me again seeking some help,

I’m trying to set a reboot schedule for my diet-pi device to keep everything fresh ,

I tried cron using this method :

  1. crontab -e
  2. add the line mentioned by Edward: 0 8 * * * /sbin/shutdown -r
  3. save with ctrl + o
  4. verify: crontab -l

But it did not work at all !

  • I tried 0 9 * * * sudo reboot
    Did not work as well
  • Note i have changed the region of diet-pi to Asia instead of London/Europe .

Thanks everyone !

From which user did you ran crontab -e?
If you ran it from user dietpi, than you edited the crontab for this user. And reboot needs root privileges, so try
sudo crontab -e and edit this file and add:
0 8 * * * /sbin/shutdown -r now

(reboot command needs a time when it should be executed, so now indicates it’s executed instantly.
BTW the f irst part of the line means it’s rebooted at 8 a.m. (minute 0, hour 8 ) Change it to you desires.

why do you like to restart your system once a day? Usually this should not be needed

i would love to keep everything fresh in my SBC and my DNS server !

Sounds great ! I will try it !

my PiHole + Unbound is running 24/7 stable without issues and memory leaks.

That’s impressive !
i do not use Pihole or unbound , i use adguard home alone , i feel like the performance drops overtime for some reasons until i restart it

did you tried to restart AGH alone to see of this is already changing thinks?
How does resource consumption looks like once you “feel” dropping performance? Did you checked htop how your system looks like?

1 - nope , can i set AGH to restart once a day ?

2 - memory increase from 175MB to 260MB with swapFiles increase to 13MB .

3 - yes looks natural except number ( number 2 issues )

Do you know the process using most memory? Maybe you would need to watch it over time and find out which processes are increasing on memory usage. First you would need to get clarity on what is going on with your system. Maybe there are running more processes increasing the memory usage day by day.

i have write down the numbers , the only one increasing is AGH

if AGH is increasing over the days and is growing on memory consumption, you might need to report it to AGH to report a potential issue (memory leak). But it depends how much it is growing and how your system is utilised in total.

Were you able to figure it out? I was having issues with my dns resolver and somehow rebooting it fixes it. Found Jappe’s fix worked for me.

[sudo crontab -e]
0 */6 * * * /sbin/shutdown -r now

[crontab -l]

verify your timezone if you’re running it on a specific time

Be careful with the periodic reboot. In many SBCs without RTC the clock upon boot might be set at a time before the reboot time.

usually on a normal reboot, system time should be written down and restored by fack-hwclock. As well save the time stamp once a hour automatically.

That’s what I am saying, the system will come up with the same time when it went for reboot, which is the time to reboot according to cron, and will endlessly reboot.

Usually it should not. Something that would need to be tested.