当前位置:网站首页>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
边栏推荐
- ASP.NET Core 6.0 基于模型验证的数据验证
- 常用在线测试工具集合
- Read and understand the advantages of the LAAS scheme of elephant swap
- 基于TensorFlow和Keras的卷积神经网络实现猫狗数据集分类实验
- JUC concurrent programming - Advanced 05 - lock free of shared model (CAS | atomic integer | atomic reference | atomic array | field updater | atomic accumulator | unsafe class)
- 谢振东:公共交通行业数字化转型升级的探索与实践
- 买收益百分之6的理财产品,需要开户吗?
- ShardingSphere-数据库分库分表简介
- VC prompts to recompile every time you press F5 to run
- P3201 [hnoi2009] dream pudding heuristic merge
猜你喜欢

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

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

先工程实践,还是先工程思想?—— 一位本科生从学oi到学开发的感悟

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

ES6 adds -iterator traversal, for..Of loop

Outlook邮件创建的规则失效,可能的原因

Implementation of cat and dog data set classification experiment based on tensorflow and keras convolutional neural network

凸优化基础知识

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

高阶产品如何提出有效解决方案?(1方法论+2案例+1清单)
随机推荐
The size of STM32 stack
Salesforce zero foundation learning (116) workflow - & gt; On flow
先工程实践,还是先工程思想?—— 一位本科生从学oi到学开发的感悟
Code coverage
PHP get thumbnails
Learn AI through detectron2
On the problem that the on-board relay cannot be switched on due to insufficient power supply
burp从溯源到反制思路
"Yuan universe 2086" outsold "San ti" in one-day sales and won the champion of JD books' one-day science fiction list
P3201 [HNOI2009] 梦幻布丁 启发式合并
Introduction to HLS programming
Entity service is an anti pattern
Trinitycore worldofwarcraft server - registration website
Detailed explanation of zhanrui Huben T310: introduce the big core and dynamiq architecture into the entry-level market for the first time!
Can the income of CICC securities' new customer financial products reach 6%? How to open an account?
Value driven provides the core driving force for the transformation of commercial BP - BP realization under business scenarios - Commercial BP sharing
WPF opens external programs and activates them when needed
Paper notes: accurate causal influence on discrete data
Oracle中实现对指定数据分组且获取重复次数
Let‘s Encrypt