H
Ham Baba
Just want to write a ruby script that reboots the computer for 10
repeated times. Is it possible? I appriciate any help.
repeated times. Is it possible? I appriciate any help.
Just want to write a ruby script that reboots the computer for 10
repeated times. Is it possible? I appriciate any help.
Ham Baba said:Just want to write a ruby script that reboots the computer for 10
repeated times. Is it possible? I appriciate any help.
=20
Ensure that your system is configured in such a manner that members of
"shutdown" can reboot the system. Create a startup script to run the = rebooter
as a member of the shutdown group. =46rom within the ruby software: = create a=20
counter" file if one does not exist, setting the count to 10. Use the = count
that the file contains. If the count is zero, then exit because the = system has
already rebooted 10 times, otherwise decrement the count and "shell = out" to=20
the reboot command.
I'm astonished that the system reboot command does not do this!Eleanor said:Remembering of course to explicitly flush the file buffer of the status file and sync the filesystem before performing the reboot
I'm astonished that the system reboot command does not do this!
=20
Closing the file is certainly necessary. Isn't the rest unnecessary?
=20
Curious
If journalling's enabled on the filesystem it's *probably* unnecessary, but
let's just say I've been stung enough times to be naturally cautious...
Jeff Peng said:You may want to write a status file for the rebooting count.
For example:
rcdFile="/tmp/reboot.rcd"
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.