How to prevent a background process from being stopped after closing SSH client in Linux

前端 未结 20 1710
悲&欢浪女
悲&欢浪女 2020-11-22 06:16

I\'m working on a Linux machine through SSH (Putty). I need to leave a process running during the night, so I thought I could do that by starting the process in background (

20条回答
  •  南旧
    南旧 (楼主)
    2020-11-22 07:17

    On a Debian-based system (on the remote machine) Install:

    sudo apt-get install tmux

    Usage:

    tmux

    run commands you want

    To rename session:

    Ctrl+B then $

    set Name

    To exit session:

    Ctrl+B then D

    (this leaves the tmux session). Then, you can log out of SSH.

    When you need to come back/check on it again, start up SSH, and enter

    tmux attach session_name

    It will take you back to your tmux session.

提交回复
热议问题