当前位置:网站首页>With screen and nohup running, there is no need to worry about deep learning code anymore | exiting the terminal will not affect the operation of server program code
With screen and nohup running, there is no need to worry about deep learning code anymore | exiting the terminal will not affect the operation of server program code
2022-07-24 23:19:00 【InfoQ】
screen
1. Connect to server

2. newly build session
screen -S name 
bash Code .sh
3. Hang up
- Use
Ctrl+ A + D, It is to throw the currently running content into the background , You can continue to use the server in the current window . It will show as follows , notice detached Then it will return to your normal terminal .

- More simply, you can open another server window .

4. Back to running code session
- If you don't remember before screen establish session What's your name , Use
screen -lsview list .

- If you remember what you created before session What's its name , Your direct
screen -r name, You can return to the operation interface .

5 eliminate session
- If you run the code , This session useless . Quit current session, then kill That's all right. . Look at the picture below , At this time, the reply list shows that I have mydemo This still exists . Kill this process directly in the yellow square OK 了 . If the program is killed, it will die ╭(●`∀´●)╯.

- If it is an abnormal death, it will show dead, Use
screen -wipeClear it OK 了 .

nohup
1. Run code
nohup Files to run > Log files 2>&1 & 
nohup demo.sh
ls
nohup demo.sh > train.log

nohup demo.sh > train.log 2>&1
2>&12>&1&2 > 1- 2 representative stderr(standard error, Standard error output )
- 1 representative stdout (standard output, standard output )
nohup demo.sh > train.log 2>&1 &
&- If you don't add this
&, The implementation is as follows , The code will stay in this interface until it runs out , Your terminal window cannot be used anymore .

- Add `&` after , Direct execution of the program ,** And throw the program in the background **, It does not affect the use of the current terminal window , You can also exit the server connection directly .

2. Check the log
3. Stop running
ps -aux | grep " Run file name " ps -def | grep " Run file name " kill -9 PID4. What to do if you report an error
Show that the executive file cannot be found
nohup file name ...nohup bash xxx.shnohup python xxx.py 
- use
llView permissions , See that the file permissions shown in the figure below do not-xThis one , It proved to be caused by lack of authority .

- use
chmod a+xAdd execution permission to the file .
-x
边栏推荐
- Qt | 事件系统 QEvent
- 价值驱动为商业BP转型提供核心动力——业务场景下的BP实现-商业BP分享
- How to propose effective solutions for high-end products? (1 methodology + 2 cases + 1 List)
- ES6 adds -iterator traversal, for..Of loop
- 聊聊 Redis 是如何进行请求处理
- Li Kou 1184. Distance between bus stops
- 凸优化基础知识
- Okaleido tiger NFT即将登录Binance NFT平台,后市持续看好
- Convex optimization Basics
- 认识复杂度和简单排序运算
猜你喜欢

CA证书制作实战

How to propose effective solutions for high-end products? (1 methodology + 2 cases + 1 List)

认识复杂度和简单排序运算

JS ------ Chapter II JS logic control

Salesforce zero foundation learning (116) workflow - & gt; On flow

JS ------ Chapter 3 JS cycle

JDBC 驱动升级到 Version 8.0.28 连接 MySQL 的踩坑记录

Old Du servlet JSP

Js----- Chapter 4 array

Icassp 2022 | KS transformer for multimodal emotion recognition
随机推荐
Can the income of CICC securities' new customer financial products reach 6%? How to open an account?
Burp's thinking from tracing to counteracting
Financial products can reach 6%. I want to open an account to buy financial products
痞子衡嵌入式:MCUXpresso IDE下将源码制作成Lib库方法及其与IAR,MDK差异
First engineering practice, or first engineering thought—— An undergraduate's perception from learning oi to learning development
Backgroundworker enables time-consuming operations without affecting interface response
Pointrender parsing
中金证券新课理财产品的收益有百分之六吗?我想要开户理财
背景图和二维码合成
Lidar obstacle detection and tracking: CUDA European clustering
ShardingSphere-数据库分库分表简介
这个月 google的“AI具备意识”的事件的想法
Mandatory interview questions: 1. shallow copy and deep copy_ Deep copy
The idea of Google's "Ai awareness" event this month
Go基础笔记_4_map
CA certificate production practice
On the open and closed principle
Mandatory interview questions: 1. shallow copy and deep copy_ Shallow copy
Notes of Teacher Li Hongyi's 2020 in-depth learning series 9
How to propose effective solutions for high-end products? (1 methodology + 2 cases + 1 List)