M
M
MeatPixel2019-11-24 21:02:44
linux
MeatPixel, 2019-11-24 21:02:44

How to ssh into a server and display a running nodejs script?

Good day, actually the question is in the title, I have a script that works in the background (socket server), it displays various real-time data in the console, in fact, how to see this console after I connected via ssh to the server without restarting the script.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Belyaev, 2019-11-24
@MeatPixel

+ to other answers, specifically for the node, there is another solution:
Run through pm2 and then watch the logs through it too

R
Ruslan Fedoseev, 2019-11-24
@martin74ua

initially run the script in screen or tmux, which, when you disconnect from the console, will simply detach from it, and the next time you connect to the server, you can connect to the previous session

D
Dmitry Shitskov, 2019-11-24
@Zarom

Depends on how this script is run.

  • And finally, you can add logging to the file in the script itself
  • Didn't find what you were looking for?

    Ask your question

    Ask a Question

    731 491 924 answers to any question