how to reboot DietPi always at 8AM with Cron?

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
vinanrra
Posts: 13
Joined: Mon Oct 24, 2016 5:57 pm

how to reboot DietPi always at 8AM with Cron?

Post by vinanrra »

I'm new with Cron and I don't know how to do it, and even with tutorials I don't make works
Edward
Posts: 93
Joined: Sun Apr 09, 2017 6:24 am

Re: how to reboot DietPi always at 8AM with Cron?

Post by Edward »

I'm thinking you could add a line to the /etc/cron.daily file like this

0 8 * * * /sbin/shutdown -r

It should reboot daily at 8AM.

Or better yet go to dietpi-launcher ->Dietpi-Cron and adjust the time from there.
Then add the command in cron.daily
User avatar
MichaIng
Site Admin
Posts: 2294
Joined: Sat Nov 18, 2017 6:21 pm

Re: how to reboot DietPi always at 8AM with Cron?

Post by MichaIng »

Please do not add it to cron.daily!! The scripts inside are running in parallel and AFAIK the shutdown/reboot would break all other daily tasks.

Create a crontab entry for root user instead:
1. crontab -e
2. add the line mentioned by Edward: 0 8 * * * /sbin/shutdown -r
3. save with ctrl + o
4. verify: crontab -l
vinanrra
Posts: 13
Joined: Mon Oct 24, 2016 5:57 pm

Re: how to reboot DietPi always at 8AM with Cron?

Post by vinanrra »

Thx, for the info :)
Post Reply