To keep my Raspberry Pi servers and players working smoothly, I use the cronjob command to make the units automatically reboot nightly or weekly, as appropriate. I'm convinced that this would also help with my various SB Touch players, which are on all the time but played infrequently and often suffer network problems until rebooted. Does anyone know a simple way to achieve this automatically?
I've done numerous searches but haven't found anything which just does this as sweetly as with the RasPis.
Thanks in advance.
Chip
Results 1 to 9 of 9
Thread: SB Touch Auto Reboot
-
2015-07-25, 02:44 #1
- Join Date
- Aug 2010
- Posts
- 154
SB Touch Auto Reboot
-
2015-07-31, 18:20 #2
- Join Date
- Mar 2012
- Posts
- 14
-
2015-08-01, 07:25 #3
- Join Date
- Aug 2010
- Posts
- 154
SSH into RasPi
execute this command:
crontab -e
The file is opened in nano
And add this as the last line:
0 3 * * * sudo /sbin/shutdown -r now
To exit press CTRL-X and save the file.
The job is then active and the raspberry will perform a reboot at 3 o’clock at night.
-
2015-08-01, 07:34 #4
-
2015-08-10, 04:51 #5
- Join Date
- Mar 2012
- Posts
- 14
I've done...
I've rebooted my touch with raspberry with cron job.
i've done with this file, and you can run via cronjob
Code:#!/usr/bin/expect # Script to start our application spawn ssh root@ip of your touch sleep 1 expect ":" sleep 1 expect ":" send "yes\r" sleep 1 send "1234\r" sleep 1 expect "*#" sleep 1 send "reboot\r" sleep 1 send "reboot\r"
sudo apt-get install expectLast edited by dettofatto; 2015-08-10 at 04:54.
-
2015-08-10, 08:36 #6
- Join Date
- Aug 2010
- Posts
- 154
That's very interesting dettofatto. May I just run through that again so I'm quite sure what you're suggesting (my linux knowledge is very limited).
You're using the RasPi to interrogate the Touch via SSH?
And the "expect" program is installed on the RasPi?
And the script you've provided is input into "expect"? I haven't come across "expect" so not sure of its capabilities.
And "expect" is triggered by cronjob on the RasPi
Somehow I thought that, since the SB Touch uses a linux OS that it should be possible to add something within the Touch software so it would be able to reboot without any external interaction. That would still be my preferred solution, provided it didn't compromise the Touch in any way, but your suggestion certainly gives me an option I hadn't considered.
Many thanks
-
2015-08-10, 17:09 #7
- Join Date
- Mar 2012
- Posts
- 14
You must install expect on your raspberry with
sudo apt-get install expect
After you must create that file
mkdir ./bin
cd ./bin
Create the script using the nano text editor
sudo nano reboot1
In the nano editor, type the script:
Paste my code
Modify with yours touch's ip
Ctrl+o
Ctrl+x
sudo chmod 755 reboot1
Insert in your cronjob, that must execute your new file
0 3 * * * sudo /home/pi/bin/reboot1
And yes I reboot my touch via ssh and I must install except because we must send some inputs, only when we except some words or symbol.
Also my knowledge of Linux (like my fake english) is very poor, but Google helps me!Last edited by dettofatto; 2015-08-10 at 17:19.
-
2015-08-11, 12:09 #8
- Join Date
- Aug 2010
- Posts
- 154
-
2021-01-17, 09:45 #9
- Join Date
- Mar 2012
- Posts
- 14