This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Scripted Reboot
#1
Hi,

Is it possible to perform a unit reboot from within a script.
i.e. a scheduled reboot every 3 weeks?

Brent
Reply
#2
Why do you want to reboot periodically?
Reply
#3
(18.08.2020, 06:33)admin Wrote: Why do you want to reboot periodically?
On all of my automation projects I like to implement this function as a safe guard against failures at inopportune moments.
Experience has told me that the most common errors occur at the reboot and as such I like to conduct controlled cycles.

BW
Reply
#4
This command will reboot the controller. Make sure you don't create infinite reboot loop.
Add some delay before the command in scheduler script to make sure it won't run again after reboot.
Code:
os.execute("reboot")

Normally this is not needed.
------------------------------
Ctrl+F5
Reply
#5
Hi Daniel,

Will this “os” command also force a save to the SD card?

If not you will end up with gaps in your trending.

As you stated: The system is designed for 24/7 operation so reboots are not needed..

FYI: I installed a LM2 - yeah believe it or not (: - in our office (behind a UPS) in 2013 and it has never rebooted sinds then and still running like a charm with quite some scripting, so this is a reliable benchmark if you ask me (: 

It’s also never upgraded and i don’t think i will ever do that, so let’s see if it runs another 7 years (:

If Petr reads this i suspect i have a HW3 suprise soon (:

BR,

Erwin
Reply
#6
Hi Erwin
Yes it does save, it's like you would press the button in the interface.
BR
------------------------------
Ctrl+F5
Reply


Forum Jump: