in reply to Re: Create a folder/file and reboot the machine and check for the created file/folder on the location.
in thread reboot a system (machine or server) multiple times with perl script

I don't think you know what a boot partition is. Suggesting that a novice alter his boot partition is tantamount to suggesting he play Russian Roulette with all chambers loaded. Perhaps you meant to say root directory (although where the file resides doesn't really matter).

use warnings; use strict; my $max_attempts = 5; # for windows, replace cat with type my $reboot_number = `cat reboot_attempts` || 0; if ($reboot_number++ < $max_attempts) { `echo $reboot_number > reboot_attempts`; print "Rebooting...\n"; # code to make computer reboot here }
Dum Spiro Spero
  • Comment on Re^2: Create a folder/file and reboot the machine and check for the created file/folder on the location.
  • Download Code

Replies are listed 'Best First'.
Re^3: Create a folder/file and reboot the machine and check for the created file/folder on the location.
by james28909 (Deacon) on Mar 13, 2015 at 21:57 UTC
    Apologies, ofcourse i meant boot drive. But in windows, my boot drive is my boot partition, because it is a 512gb ssd unpartitioned.

    Either way the point was to write and/or modify a file per reboot.
Re^3: Create a folder/file and reboot the machine and check for the created file/folder on the location.
by irthiza90 (Novice) on Mar 16, 2015 at 06:45 UTC

    well the o.s here is ubuntu.