Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Is there any way to get the status of a SSH command back?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Is there any way to get the status of a SSH command back?

myhkenmyhken Member

I just run aa command to get Windows on a Online.net server. Then I got a little outage on my ISP, and I lost Putty access to my server. It was almost ready, but are there any way I can get the status back?

Comments

  • Not quite sure if this is possible as the process would terminate when you logout (if it was running in foreground); you should definitely be using screen or nohup for this, but maybe you can find these answers of help: http://stackoverflow.com/questions/954302/how-to-make-a-programme-continue-to-run-after-log-out-from-ssh

    Thanked by 2vpsGOD myhken
  • I run screen everytime i need to run anything need long time to finished

    Thanked by 1myhken
  • tommytommy Member

    screen is your friend, after back use fg

    Thanked by 1myhken
  • vedranvedran Veteran

    nohup command > command.log 2>&1 &

    If you want to see the output just use tail -f command.log

  • MacPacMacPac Member

    How about supervisor ?

  • DACDAC Member

    Hi myhken,

    For this command you were running, it'd be best to start over. But you can use nohup command in the future to keep the ssh session logged on even if you close the window or have to turn off your computer. So you don't have something like this happen again, but for this one i'd suggest starting the process over again to avoid any issues.

    Thanked by 1myhken
  • myhkenmyhken Member

    I use a Remote Desktop on one of my servers, so it's always on. I also use a VPN solution with a dedicated IP (all my Windows Servers has only three IPs allowed to connect to them). Today it was the VPN provider that was down for 2-3 minutes, long enough that the SSH connection was lost. It was the first time ever it has happened to me, but tnx for all good advice in this thread, and I will see if I'm will use them in the future.

  • ssh root@xxx ; echo $?

    Will return 0 for successful exit status, and something else for failure.

    Thanked by 1myhken
  • blackblack Member

    tmux is also a good choice

    Thanked by 1myhken
Sign In or Register to comment.