Naming Screen Session Log Same As Screen Session Name

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm currently writing an update / launch script for multiple game servers, and am wanting to add auto-update functionality to the game servers.



startL4D2.sh



screen -mdS left4dead2_server /home/dustin/Steam/SteamFolder/L4D2/srcds_run -game left4dead2 ...


  1. Is it possible to have the screen output log file (screen -L) be named the same
    as the screen session name (left4dead2_server)? All game servers will have a unique screen name.

  2. I'd want the file to be overwritten every time the server launches (so the screen log is only from the last active session). For example, for this particular server, the screen log is saved as 'left4dead2_server.output'. For a CS:GO server, it might be CSGO.output. There can be anywhere from 1 to 10+ servers on the same machine, all with unique screen names.

So basically I'd be doing something like this:



  • (Before game server launches) Does a screen output log exist with the same name as the screen name that's about to be launched?

  • If yes, grep for word "MasterRequestRestart" from that log file. If found - there'll be an update before the server launches.








share







New contributor




johndoe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    0
    down vote

    favorite












    I'm currently writing an update / launch script for multiple game servers, and am wanting to add auto-update functionality to the game servers.



    startL4D2.sh



    screen -mdS left4dead2_server /home/dustin/Steam/SteamFolder/L4D2/srcds_run -game left4dead2 ...


    1. Is it possible to have the screen output log file (screen -L) be named the same
      as the screen session name (left4dead2_server)? All game servers will have a unique screen name.

    2. I'd want the file to be overwritten every time the server launches (so the screen log is only from the last active session). For example, for this particular server, the screen log is saved as 'left4dead2_server.output'. For a CS:GO server, it might be CSGO.output. There can be anywhere from 1 to 10+ servers on the same machine, all with unique screen names.

    So basically I'd be doing something like this:



    • (Before game server launches) Does a screen output log exist with the same name as the screen name that's about to be launched?

    • If yes, grep for word "MasterRequestRestart" from that log file. If found - there'll be an update before the server launches.








    share







    New contributor




    johndoe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm currently writing an update / launch script for multiple game servers, and am wanting to add auto-update functionality to the game servers.



      startL4D2.sh



      screen -mdS left4dead2_server /home/dustin/Steam/SteamFolder/L4D2/srcds_run -game left4dead2 ...


      1. Is it possible to have the screen output log file (screen -L) be named the same
        as the screen session name (left4dead2_server)? All game servers will have a unique screen name.

      2. I'd want the file to be overwritten every time the server launches (so the screen log is only from the last active session). For example, for this particular server, the screen log is saved as 'left4dead2_server.output'. For a CS:GO server, it might be CSGO.output. There can be anywhere from 1 to 10+ servers on the same machine, all with unique screen names.

      So basically I'd be doing something like this:



      • (Before game server launches) Does a screen output log exist with the same name as the screen name that's about to be launched?

      • If yes, grep for word "MasterRequestRestart" from that log file. If found - there'll be an update before the server launches.








      share







      New contributor




      johndoe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I'm currently writing an update / launch script for multiple game servers, and am wanting to add auto-update functionality to the game servers.



      startL4D2.sh



      screen -mdS left4dead2_server /home/dustin/Steam/SteamFolder/L4D2/srcds_run -game left4dead2 ...


      1. Is it possible to have the screen output log file (screen -L) be named the same
        as the screen session name (left4dead2_server)? All game servers will have a unique screen name.

      2. I'd want the file to be overwritten every time the server launches (so the screen log is only from the last active session). For example, for this particular server, the screen log is saved as 'left4dead2_server.output'. For a CS:GO server, it might be CSGO.output. There can be anywhere from 1 to 10+ servers on the same machine, all with unique screen names.

      So basically I'd be doing something like this:



      • (Before game server launches) Does a screen output log exist with the same name as the screen name that's about to be launched?

      • If yes, grep for word "MasterRequestRestart" from that log file. If found - there'll be an update before the server launches.






      logs gnu-screen





      share







      New contributor




      johndoe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      johndoe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      johndoe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 6 mins ago









      johndoe

      61




      61




      New contributor




      johndoe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      johndoe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      johndoe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          johndoe is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475340%2fnaming-screen-session-log-same-as-screen-session-name%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          johndoe is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          johndoe is a new contributor. Be nice, and check out our Code of Conduct.












          johndoe is a new contributor. Be nice, and check out our Code of Conduct.











          johndoe is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475340%2fnaming-screen-session-log-same-as-screen-session-name%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?