linux server file exchange, and tasks running in the background

Copyright: welcome the exchange of learning, please indicate the source. https://blog.csdn.net/qq_23869697/article/details/89502343

Server-related work, introduced here as long as four commands.

  • rz, from the client to upload files to the server
  • sz, retrieve files from the server to the local
  • nohup, do not hang up run
  • &,Background process

y, s

Linux, rz and sz command usage Detailed

Example:
I want to run a python script on the server test.py , this script locally, using ftp transfer log in to more trouble, use the command directly.
Provided that you install the appropriate package.
Direct input rz command, window-side file selection window will pop up, select the desired upload file

rz

If I just test.py do a little modification, trying to take it back before replacing the file from the server directly using the following command

sz test.py

Then select the storage directory.

nohup does not hang up run

Reference: nohup Command
command format:nohup 命令

Test.py just might want to do 10 hours, I may have to quit during landing, disconnect from the server, and we hope that it will still be able to perform up to the end in this case.

nohup python test.py 

& Background process

linux background execution command: & nohup and
formatting commands: 命令 &
just a script running in the background, you need only use the following command:

 python test.py &

It runs to completion in the background

nohup python test.py &

More good text: https://www.cnblogs.com/baby123/p/6477429.html

After running below
result
generate a PID, there is also designed to output a question
it will ask: ignoring input and appending output to ' nohup.out
if not designate an output log file, default output to a file nohup.out
specific What operating found here: Linux nohup, &, what 2> & 1?
Also enables command line log output: nohup realize command line log output

Guess you like

Origin blog.csdn.net/qq_23869697/article/details/89502343