Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Donate
Collapse

Plutonium

  1. Home
  2. BO2 Server Hosting Support
  3. Graceful Shutdown for live server

Graceful Shutdown for live server

Scheduled Pinned Locked Moved BO2 Server Hosting Support
6 Posts 4 Posters 133 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ghlegend195undefined Offline
    ghlegend195undefined Offline
    ghlegend195
    wrote on last edited by
    #1

    So, I have a server that's running fine with the current IW4MAdmin installed.

    However, I can't leave this server running for days at a time and I want an automated way to shutdown the server gracefully, be it after a set time or on map rotation.

    Is this possible with either server commands or IW4MAdmin commands?

    Thanks!~

    1 Reply Last reply
    0
    • Decundefined Offline
      Decundefined Offline
      Dec Contributor
      wrote on last edited by
      #2

      Ive looked into this for BO1 since after like 30 mins of inactivity the session seems to just fail out of no where and throws the session error.

      You could use windows provided task schedular to start the !start bat file and then after a period of time run another bat to shutdown the !start bat and map restarter bat file and you can set it to cycle every x amount for x amount of days/months/years whatever.

      this should also be possible with windows powershell and also bat alone.

      1 Reply Last reply
      0
      • Decundefined Offline
        Decundefined Offline
        Dec Contributor
        wrote on last edited by Dec
        #3

        this will work but it shuts down all cmd.exe/command prompt windows

        save this in .bat:

        Echo on
        :serverstart
        cls
        start C:\Users\Weedliketoosmoke\Desktop\plutonium-bo2-server!start_zm_server.bat
        timeout /t 10
        taskkill /F /T /IM cmd.exe
        goto serverstart

        Alternative:
        if u want to start the server back up after x amount of seconds

        download this and put in the same server files as your !start bat: https://github.com/npocmaka/batch.scripts/blob/master/hybrids/.net/getCmdPID.bat

        Echo on
        :serverstart
        cls
        start C:\Users\Weedliketoosmoke\Desktop\plutonium-bo2-server!start_zm_server.bat
        timeout /t 10
        call getCmdPID
        set "current_pid=%errorlevel%"
        for /f "skip=3 tokens=2 delims= " %%a in ('tasklist /fi "imagename eq cmd.exe"') do (
        if "%%a" neq "%current_pid%" (
        TASKKILL /PID %%a /f >nul 2>nul
        )
        )
        for /f "skip=3 tokens=2 delims= " %%a in ('tasklist /fi "imagename eq plutonium-bootstrapper-win32.exe"') do (
        if "%%a" neq "%current_pid%" (
        TASKKILL /PID %%a /f >nul 2>nul
        )
        )
        goto serverstart

        1 Reply Last reply
        0
        • ghlegend195undefined Offline
          ghlegend195undefined Offline
          ghlegend195
          wrote on last edited by
          #4

          Thanks, but I was curious if there was anything within Plutonium server commands or IW4MAdmin commands to achieve this end. I suppose I'll just run a say command on my server then run a batch script that shuts down the entire computer in 15 minutes. Not near as pretty, but I guess it'll do.

          Dss0undefined 1 Reply Last reply
          0
          • Dss0undefined Offline
            Dss0undefined Offline
            Dss0 Plutonium Staff
            replied to ghlegend195 on last edited by
            #5

            ghlegend195 you can send "quit" to the server via iw4madmin

            !rcon quit
            

            but you'd still need to write a plugin for it to automatically do this after x time. There is no such functionality integrated.

            1 Reply Last reply
            1
            • Xerxesundefined Online
              Xerxesundefined Online
              Xerxes Plutonium Staff
              wrote on last edited by
              #6

              You could use my plugin for IW4m-Administrator to automate it. Just set-up the say message and send a quit a few minutes later.

              1 Reply Last reply
              0

              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Donate