System Corn Reboot Pi-Star

General support for the Pi-Star System
M6NBP
Posts: 61
Joined: Mon Oct 01, 2018 1:39 pm

System Corn Reboot Pi-Star

Post by M6NBP » Fri Jun 07, 2019 3:11 pm

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

User avatar
VK7HSE
Posts: 168
Joined: Sun Apr 15, 2018 6:35 pm
Contact:

Re: System Corn Reboot Pi-Star

Post by VK7HSE » Fri Jun 07, 2019 3:37 pm

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


M6NBP
Posts: 61
Joined: Mon Oct 01, 2018 1:39 pm

Re: System Corn Reboot Pi-Star

Post by M6NBP » Fri Jun 07, 2019 4:05 pm

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

User avatar
VK7HSE
Posts: 168
Joined: Sun Apr 15, 2018 6:35 pm
Contact:

Re: System Corn Reboot Pi-Star

Post by VK7HSE » Fri Jun 07, 2019 4:19 pm

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


M6NBP
Posts: 61
Joined: Mon Oct 01, 2018 1:39 pm

Re: System Corn Reboot Pi-Star

Post by M6NBP » Fri Jun 07, 2019 4:25 pm

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.

.

User avatar
VK7HSE
Posts: 168
Joined: Sun Apr 15, 2018 6:35 pm
Contact:

Re: System Corn Reboot Pi-Star

Post by VK7HSE » Fri Jun 07, 2019 4:36 pm

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


Last edited by VK7HSE on Fri Jun 07, 2019 4:36 pm, edited 1 time in total.

M6NBP
Posts: 61
Joined: Mon Oct 01, 2018 1:39 pm

Re: System Corn Reboot Pi-Star

Post by M6NBP » Fri Jun 07, 2019 4:47 pm

Just looked in /usr/local/sbin/ and can not see a shutdown command.
Capture.JPG
Capture.JPG (117.21 KiB) Viewed 460 times

User avatar
VK7HSE
Posts: 168
Joined: Sun Apr 15, 2018 6:35 pm
Contact:

Re: System Corn Reboot Pi-Star

Post by VK7HSE » Fri Jun 07, 2019 5:00 pm


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


User avatar
VK7HSE
Posts: 168
Joined: Sun Apr 15, 2018 6:35 pm
Contact:

Re: System Corn Reboot Pi-Star

Post by VK7HSE » Fri Jun 07, 2019 5:06 pm

If you change to the root user and just try...

Code: Select all

sudo - s
/sbin/shutdown -r now
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! Image

Sent from my Pixel 2 XL using Tapatalk



Last edited by VK7HSE on Fri Jun 07, 2019 5:06 pm, edited 1 time in total.

M6NBP
Posts: 61
Joined: Mon Oct 01, 2018 1:39 pm

Re: System Corn Reboot Pi-Star

Post by M6NBP » Fri Jun 07, 2019 5:13 pm

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
Capture.JPG (25.23 KiB) Viewed 451 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

Post Reply