Page 1 of 2
System Corn Reboot Pi-Star
Posted: Fri Jun 07, 2019 3:11 pm
by M6NBP
Hi.
Can someone make a command line to add to System Corn to reboot Pi-Star at 3am ?
Would want this to happen every day at 3am
Hope someone can help.
Many thanks
Norman
Re: System Corn Reboot Pi-Star
Posted: Fri Jun 07, 2019 3:37 pm
by VK7HSE
Firstly you don't want to select 3am because this is the time that the overnight updates are run!
Under the expert tab you will see one titled System Cron, go into that and add to the end of the list
Code: Select all
15 4 * * * root /sbin/shutdown -r now >/dev/null 2>&1
This will reboot the pi at 04:15am every day!
Sent from my Pixel 2 XL using Tapatalk
Re: System Corn Reboot Pi-Star
Posted: Fri Jun 07, 2019 4:05 pm
by M6NBP
I just tried
Code: Select all
3 17 * * * root /sbin/shutdown -r now >/dev/null 2>&1
It did not reboot at 17.03hrs
Any help welcome
Re: System Corn Reboot Pi-Star
Posted: Fri Jun 07, 2019 4:19 pm
by VK7HSE
Ok I thought by specifying the full syntax would have worked! So try...
Code: Select all
3 17 * * * root reboot >/dev/null 2>&1
See how you go!
Sent from my Pixel 2 XL using Tapatalk
Re: System Corn Reboot Pi-Star
Posted: Fri Jun 07, 2019 4:25 pm
by M6NBP
Also tried this and it did not work
Code: Select all
22 17 * * * root /usr/local/sbin/shutdown -r now >/dev/null 2>&1
Have also restarted Pi-Star when made any changes to make sure the new setting will be read.
.
Re: System Corn Reboot Pi-Star
Posted: Fri Jun 07, 2019 4:36 pm
by VK7HSE
Ok you can pipe the output of the command to a text file with...
Code: Select all
40 17 * * * root /sbin/shutdown -r now > /home/pi-star/cron_output.txt
Just make sure you have the drive set to rw access! Otherwise it cannot write the file...
Sent from my Pixel 2 XL using Tapatalk
Re: System Corn Reboot Pi-Star
Posted: Fri Jun 07, 2019 4:47 pm
by M6NBP
Just looked in /usr/local/sbin/ and can not see a shutdown command.
- Capture.JPG (116.83 KiB) Viewed 4196 times
Re: System Corn Reboot Pi-Star
Posted: Fri Jun 07, 2019 5:00 pm
by VK7HSE
Scratch trying to pipe the output cause the pi essentially is to fast on the shutdown!
Code: Select all
15 3 * * * root /sbin/shutdown -r now >/dev/null 2>&1
Sent from my Pixel 2 XL using Tapatalk
Re: System Corn Reboot Pi-Star
Posted: Fri Jun 07, 2019 5:06 pm
by VK7HSE
If you change to the root user and just try...
This should cause the pi to reboot! (I've just tested it and it works)
Code: Select all
15 3 * * * root /sbin/shutdown -r now >/dev/null 2>&1
So this "should" work!
Sent from my Pixel 2 XL using Tapatalk
Re: System Corn Reboot Pi-Star
Posted: Fri Jun 07, 2019 5:13 pm
by M6NBP
This worked
Code: Select all
5 18 * * * root reboot >/dev/null 2>&1
But only when I moved the code to the top of the list
- Capture.JPG (25.16 KiB) Viewed 4187 times
So if I do
Code: Select all
15 4 * * * root reboot >/dev/null 2>&1
That will reboot at 04.15am every day.
Thank you so much for all your help
Norman M6NBP