To exit SSH, the program continues to run the workaround

Source: Internet
Author: User

UNIX, Linux Class Server maintenance is often done through SSH, and some operations take a long time, such as: Updates, file backup, software compilation and installation. If you disconnect the SSH connection, the update will be interrupted. How can you keep the update process running after you disconnect ssh? There are two ways of doing this:

1, Nohup

#nohup Application Name &

After that, if you disconnect ssh, the program is still running.

If you need to end the process after you run it, you need to kill the way.


2. Screen

Install the screen first through the Yum install-y screen, apt-get install Screen-y .
(1) How to run the required process through screen:

#screen

Then press the SPACEBAR or enter the screen session, you can run the user needs the program.

(2) How to exit screen after running the required process

After running the process required by the user, you can switch back to the main interface before running screen by pressing CTRL + A and then pressing the D key.

After exiting screen, the user can make other operations or disconnect the SSH connection if the process is guaranteed to run normally.

(3) View the currently existing screen session
#screen-ls

The results are as follows:

(4) How to access an existing screen session

#screen-R Session Code

Such as:

Screen-r 8858.pts-0.iz28*****

You can enter the screen session where the user executed the process.

13:41:38

To exit SSH, the program continues to run the workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.