In the server, the program is running in the background, when writing a Python script, you need:
If you want Python robot.py & is not possible, once the user log out, the script will automatically exit. With at, Cron can be implemented, but I found a command.
Nohup, can ignore log out of the signal, now as long as
Nohup python robot.py &
Just fine. If you want to record the print in Python, you can
Nohup python robot.py & >/log/log1.log
View Python--pid running in the background
Command:ps-ef |grep python
Find the execution file and its path in Linux based on the PID value of the process
Lsof-p PID
1.3 FG Command (foreground)
This command will transfer the process running in the background to the foreground to run. Specific usage: FG%n. Here n is the jobnumber that Jobs sees. Such as:
The following commands can be used to manipulate process tasks:
PS Lists the processes that are running in the system
Kill sends a signal to one or more processes (often used to kill a process)
Jobs lists the processes that belong to the current user
BG moves the process to the background (Background)
FG moves the process to the foreground (Foreground)
Running the Python scripting service in the background