have R halt the EC2 machine it's running on

后端 未结 4 2031
深忆病人
深忆病人 2021-02-09 01:50

I have a few work flows where I would like R to halt the Linux machine it\'s running on after completion of a script. I can think of two similar ways to do this:

  1. r
4条回答
  •  暖寄归人
    2021-02-09 02:40

    AFAIK those ways you mentioned are the only ones. In any case the script will have to run as root to be able to shut down the machine (if you find a way to do it without root that's possibly an exploit). You ask for an easier way but system("halt") is just an additional line at the end of your script.

提交回复
热议问题