1

I was running a process in background like:

java -jar RateUpdate.jar&

The output was showing up in the putty terminal. However I lost ssh connection to my putty terminal and so restarted the session. I can see that the process I ran in background is still running(using ps aux|grep java) However I want to see the output as well as I was getting before I lost connection.How can I do that .Could anyone suggest?

3 Answers 3

2

You can use screen. See some examples here, and here some examples with ssh to solve your connections lost.

Sign up to request clarification or add additional context in comments.

1 Comment

+1. I suggest adding an immediate example on how to run the command java -jar RateUpdate.jar with screen, and restore it after reconnecting with another ssh session.
0

If you know in advance that you are going to need to reconnect and resume the command your best bet would be to use tmux. It is a modern remake of the older utility GNU Screen.

However if you did not know in advance and you want to save a program which is already "lost" with no terminal you can use reptyr to reattach it to a terminal to get it back.

Comments

0

I used the following:

nohup java -jar RateUpdateBUS.jar>log22Julylog &

and it worked just fine.Closing the terminal didnt stop the process and output was redirected to log22Julylog file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.