Keep processes running in the background and even after SSH session disconnects
I started running a computation-intensive python script on a SSH session. But the session kept disconnecting and I lost all my results all the time. The solution was to run the script in the background without interrupting.
Linux nohup Command works perfectly in this scenario.
The syntax is:
nohup python3 code.py &
The & makes it run in the background so we can keep interacting with the terminal.
If you want to bring it back to foreground, use fg. If you want to bring it back to foreground, use Ctrl+z. But it's stopped after Ctrl+z. bg is to make it run again.
相關文章
- LeetCode之Sum of Even Numbers After Queries(Kotlin)LeetCodeKotlin
- oracle中的processes,session,transaction引數詳解OracleSession
- How To Retry Multiple Errored Approval Workflow Processes After A Fix Or Patch Has Been ImplementedErrorAPP
- Failed to restart Polybase Data Movement service after running sp_polybase_join_groupAIREST
- ORA-00445: background process "J000" did not start after 120 seconds
- 程式(Processes)
- ascp: Failed to open TCP connection for SSH, exiting. Session Stop (Error: Failed to open TCP connection for SSH)AITCPSessionError
- 配置yilia/even
- 1002 Running Median
- Systematic index design consists of two processesIndex
- background-origin和background-clip區別
- [ARC146C] Even XOR
- It's not even the whole quest. In this article
- 【kickstart 2018 round A】 Even Digits PythonGitPython
- 328. Odd Even Linked List
- background 屬性
- background屬性
- CSS background 背景CSS
- CSS background背景CSS
- CF2031F Penchick and Even Medians
- LeetCode之Odd Even Linked List(Kotlin)LeetCodeKotlin
- [LeetCode] 328. Odd Even Linked ListLeetCode
- keep-aliveKeep-Alive
- CSS background-positionCSS
- CSS background-sizeCSS
- CSS background-clipCSS
- CSS background-originCSS
- CSS:background-imageCSS
- 【log3】background
- 背景圖-background定位
- Solution - Codeforces 2031F Penchick and Even Medians
- [ABC126D] Even Relation 題解
- DevOps is Hard、DevSecOps is Even Harder. --- Enterprise Holdidev
- Running Man-奔跑吧,勇士
- running-a-command-prompt-as-nt-authoritysystem
- Laravel: Up and Running (1):介紹Laravel
- PostgreSQL DBA(142) - PG 12(Monitoring PostgreSQL VACUUM processes)SQL
- vue <keep-alive>VueKeep-Alive