2023年5月2日 星期二

Keep a process running after exiting SSH session

 

https://www.halfbit.de/howtos/keep-ssh-process/


ctrl+z
bg
disown
exit
ssh
ps- -ef



Keep a process running after exiting SSH session

  1. In SSH, launch the process you wish to keep in background, for example
cp -Rv /mnt/red/*.* /mnt/black
  1. Suspend the process by pressing Ctrl-Z.
  2. Resume suspended process in background by typing bg.
  3. Detach the process from SSH session by typing disown.
  4. Exit the SSH by typing exit.

The process will continue running in background.

🍭 Typing fg at step (3) will bring the process back to foreground.

沒有留言:

張貼留言

202501 Debian USB LAN Card Bridge

 202501 Debian USB LAN Card Bridge ChatGPT Question I have a machine running debian 12 with a LAN port using a cable to connect to my office...