We often come across telnet/ssh to log in to a remote Linux server and run some time-consuming tasks. As a result, the task fails midway due to network instability, system timeout, or user logout. So how do you let the command be submitted without being disturbed by the local closed terminal window/network disconnection? Here are some practical examples collected. You can choose different ways to solve this problem for different scenarios.
1. Business Scenario 1:
We know that when a user logs out or the network is disconnected, the terminal will receive a HUP (hangup) signal to shut down all its child processes. Therefore, our solution has two ways: either let the process ignore the HUP signal, or let the process run in a new session to become a child process that does not belong to this terminal.
1. nohup
nohup is undoubtedly the first thing we think of. As the name implies, the purpose of nohup is to have the submitted command ignore the hangup signal. Simply add nohup to the command you want to process, and standard output and standard error will be redirected to the nohup.out file by default. In general, we can add ”&” to put the command into the background at the end, or use ”>filename 2>&1″ to change the default redirect file name.
Show 1:
[root@test ~]# nohup ping www.chinaunix.net &
[1] 3059
nohup: Appending output to `nohup.out’
[root@test ~]# ps -ef
disk partitioning under Linux, file system formatting and raid devicecomparing disk partition format
In Windows, Sogou Pinyin input method has a large number of users because of its large vocabulary an
1. Lock the redundant self-built account in the systemCheck method:Execute the command#cat /etc/pas
Under the Linux partition is more troublesome, the more convenient tool is called fdiskWe can use t
The use of regular expressions and grep commands under Linux
Detailed ldconfig command, linux dynamic link library
LCD & framebuffer development experience
Linux operation and maintenance commonly used commands and knowledge Daquan
Familiar with Linux virus to do system protection engineering
Sarg installation configuration tutorial
Novice Academy: Ways to Add Linux to Windows Domain
Make:arm-linux- conmand not found error handling discussion
Scientific linux build jdk myeclipse tomcat environment
Linux operating system program foreground background switching
Windows 8 disables drivers in Device Manager
Win10 uninstall IE separately retains the edge of the method
Win7 prompts because the device has problems Windows has stopped it?
See how the heroes solve the problem of booting "press F1 into the xp system"
Analysis of the cause of logo screen crash when booting under win7 pure 32-bit system
Win7 system 4G memory Why only 2G memory available
WP8 version Sina Weibo v3.1 official version download
Win10 start menu to add ads Users can block