Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Eric Peterson
January 7, 2005, 6:02 am
rate this thread
system "shutdown -r now";
`shutdown -r now`;
and variations with 10 second delay, or with and without a newline (\n)
> Sorry for the cross-posting, but I'm not sure if this question lands on
> perl side of things, or the linux side...
> I have a perl script that runs once a minute to check various things.
> one condition I want it to reboot the system. The command line equivalent
> of "shutdown -r 10". I can get the script to work perfectly if I manually
> run it from the command-line, "./myshutdownscript.pl". But when it runs
> automatically from cron, the shutdown command seems to be ignored, though
> all other output indicates the perl script is running fine.
> Any suggestions?
> Using: Debian Sarge, kernel 2.6, pentiumIII box, Perl 5.8.4