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.

沒有留言:

張貼留言

2007 to 2023 HP and Dell Servers Comparison

  HP Gen5 to Gen11  using ChatGPT HP ProLiant Gen Active Years CPU Socket Popular HP CPUs Cores Base Clock Max RAM Capacity Comparable Dell ...