slartibartfast wrote: > I have set an alarm on my phone reminding me to reboot my always on > players every 24 days.
I have established a cron-job running on my (Linux) Server that is now rebooting all my Radios and my Touch once a week at a convenient point of time. I had to fiddle around a bit to get the ssh command working properly, but I like logging in via ssh much more than via "expect" command (which was described in the other thread, see https://forums.slimdevices.com/archi.../t-104028.html). What I did is this: 1. Install the PowerSave plugin on all devices. 2. Enable Remote Login via SSH on all devices. 3. Allow me to log in from my server via SSH at all by allowing SHA1, see my post #41, 966709, otherwise you'll get this error message: -Unable to negotiate with xxx.xxx.xxx.xxx port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1- 4. Give all my devices individual names in my network by logging in via SSH and editing their -/etc/hostname- files. Note that setting the device name from the main menu of the Squeezeboxes is *not* sufficient for this. When logged in via SSH you can use a command like this: Code: -------------------- # echo "SomeCoolName" >/etc/hostname -------------------- 5. Now, allow certificate-based SSH login from my server by spreading the user certificate of my root user account on my server to all Squeezeboxes using -ssh-copy-id-. E.g.: Code: -------------------- root@Server:~# ssh-copy-id squeezeboxradio -------------------- 6. On my server, create a batch file -/root/reboot-squeezeboxes.sh- that is logging into all my Squeezeboxes sequentially and rebooting them. E.g. the content of my batch is: Code: -------------------- #!/bin/sh logger "rebooting squeezeboxes" ssh squeezeboxradio "sh -c 'nohup /sbin/reboot -d 3 >/dev/null 2>&1 &'" ssh squeezeboxradio2 "sh -c 'nohup /sbin/reboot -d 3 >/dev/null 2>&1 &'" ssh squeezeboxradiou "sh -c 'nohup /sbin/reboot -d 3 >/dev/null 2>&1 &'" ssh squeezeboxtouch "sh -c 'nohup /sbin/reboot -d 3 >/dev/null 2>&1 &'" -------------------- Note that -nohup- must be used on the Squeezeboxes so that SSH is able to correctly close the connection before the reboot actually takes place, otherwise the SSH connection will timeout. 7. Make the batch file created in the previous step executable: Code: -------------------- root@Server:~# chmod a+x reboot-squeezeboxes.sh -------------------- 8. finally: add a cron-job executing this batch script at a convenient point of time. On my server, I created a file -/etc/cron.d/reboot-squeezeboxes- with the following content: Code: -------------------- # m h dom mon dow user command 0 15 * * 3 root /root/reboot-squeezeboxes.sh -------------------- Thus my Squeezeboxes reboot once a week, at Wednesday 3:00pm. 1x Squeezebox Classic, 3x Radio, 1x Touch, LMS 7.9.1 running on ODROID-U3, Ubuntu 16.04 and I'm happy with it! :) ------------------------------------------------------------------------ Steevee28's Profile: http://forums.slimdevices.com/member.php?userid=36395 View this thread: http://forums.slimdevices.com/showthread.php?t=111650 _______________________________________________ Radio mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/radio
