当前位置:网站首页>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
边栏推荐
- 先工程实践,还是先工程思想?—— 一位本科生从学oi到学开发的感悟
- Upgrade the jdbc driver to version 8.0.28 and connect to the pit record of MySQL
- Is the income of CICC securities' new financial products 6%? I want to open an account and manage money
- Old Du servlet JSP
- Notes of Teacher Li Hongyi's 2020 in-depth learning series 5
- ASP.NET Core 6.0 基于模型验证的数据验证
- Pointrender parsing
- JDBC 驱动升级到 Version 8.0.28 连接 MySQL 的踩坑记录
- In pgplsql: = and=
- RichTextBox operation
猜你喜欢

基于FPGA的VGA显示

Paper notes: accurate causal influence on discrete data

ShardingSphere-数据库分库分表简介

Zheng Huijuan: Research on application scenarios and evaluation methods of data assets based on the unified market

First engineering practice, or first engineering thought—— An undergraduate's perception from learning oi to learning development

Convert a string to an integer and don't double it

Notes of Teacher Li Hongyi's 2020 in-depth learning series 8

Icassp 2022 | KS transformer for multimodal emotion recognition

Value driven provides the core driving force for the transformation of commercial BP - BP realization under business scenarios - Commercial BP sharing

QT6 with vs Code: compiling source code and basic configuration
随机推荐
Is it safe to log in the securities account on the flush
Nvida tensorrt deployment (I)
Connector in C
Network Security Learning (II) IP address
The tragic experience of installing scikitlearn on win764
About constant modifier const
Process / thread synchronization mechanism
Network Security Learning (V) DHCP
Is it safe for Guosen Securities to open a mobile account
QDir类的使用 以及部分解释
CA证书制作实战
用VS Code搞Qt6:编译源代码与基本配置
Effect evaluation of generative countermeasure network
NVIDA-TensorRT部署(一)
MySQL查询慢的一些分析
聊聊 Redis 是如何进行请求处理
新手哪个证券开户最好 开户最安全
Burp's thinking from tracing to counteracting
Three ways of shell debugging and debugging
Salesforce zero foundation learning (116) workflow - & gt; On flow