Python programs run in Linux background

Source: Internet
Author: User

1.nohup command

Nohup nohup command usage: Linux command usage, do not hang up to run the command. Syntax: Nohup Command [Arg ...] [&] Description: The nohup command runs commands specified by the command parameter and any related ARG parameters, ignoring all hang-up (SIGHUP) signals. Use the Nohup command to run a program in the background after logging off.   To run the Nohup command in the background, add & (the symbol representing "and") to the end of the command. If the output of the Nohup command is not redirected, the output is appended to the Nohup.out file in the current directory. If the nohup.out file for the current directory is not writable, the output is redirected to the $HOME/nohup.out file. If no file can be created or opened for appending, then the command specified by the commands parameter is not callable.   If the standard error is a terminal, then all output of the specified command to the standard error is redirected to the same file descriptor as the standard output.   Exit Status: This command returns the following exit values: 126 You can find but cannot invoke the command specified by the command parameter.   The 127 nohup command has an error or cannot find the command specified by the commands parameter.   Otherwise, the exit status of the Nohup command is the command parameter that specifies the exit state of the commands. Nohup command and its output file Nohup command: If you are running a process and you feel that the process will not end when you exit the account, you can use the Nohup command. This command can continue to run the process after you exit the account/close the terminal.   Nohup is the meaning of not hanging (n ohang up). The general form of the command is: Nohup Command & Submit a job using nohup commands if the job is submitted with the Nohup command, all output of the job is redirected to a file named Nohup.out by default, unless the output file is specified separately: no   Hup command > Myout.file 2>&1 & In the example above, the output is redirected to the Myout.file file.   Use jobs to view tasks.   Use FG%n to close. There are also two commonly used FTP tools Ncftpget and Ncftpput, can be implemented in the background FTP upload and download, so I can use these commands in the background to upload and download files.

2. The program runs in the background & boot Nohup python yourscript.py & can let your program run in the background, console output guide nohup.out file to boot, write to boot text inside/etc/rc.d/ Rc.local

Python programs run in Linux background

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.