in reply to reboot a system (machine or server) multiple times with perl script

What operating system does the machine have?
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re: reboot a system (machine or server) multiple times with perl script

Replies are listed 'Best First'.
Re^2: reboot a system (machine or server) multiple times with perl script
by irthiza90 (Novice) on Mar 13, 2015 at 10:32 UTC

    It's ubuntu

      There are various ways to automatically start a script on ubuntu. See http://askubuntu.com/questions/814/how-to-run-scripts-on-start-up

      This script will be restarted each time, so you have to leave information about what to do next on your system.

      Like writing to a file before rebooting and reading the status after restart.

      If availability matters you'll need another machine monitoring the process.

      BTW: Plz do not repost your question again!

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)

      PS: Je suis Charlie!

Re^2: reboot a system (machine or server) multiple times with perl script
by irthiza90 (Novice) on Mar 13, 2015 at 11:22 UTC

    is it possible ? , I mean i have tried pulling in the command system('reboot') with loop statments but none seem to be working, it reboots once but the loop is not functional.

      Once the system reboots, the script is no longer running. You have to leave some kind of persistent information for the system to iterate the next step, probably create a file somewhere. You also have to configure the system to check for the information upon start-up.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

        yeah, its kind of impossible until i modify my system to execute other commands in the startup, but is there a way to make the system or server sleep for say few secs and later pinging it to confirm that its active ? Please help, Thank you,

        Let me rephrase my question here again, i need to connect the system with ssh and then 1) the script should make the host to reboot 2) the script should ping for the Ip address after the reboot 3) once the host is back script should say host is up 4) then again script should start the reboot. is this possible ?

      Rebooting the machine WILL stop your running script. You'll have to set things up so that the script gets restarted on the next reboot.