nohup
The command nohup
(stands for “No hang up”) allows your script to run even if you quit the terminal. It can be very useful, especially if your terminal has been opened through ssh
and you have a dodgy connection. It can be used as follows:
nohup python my_script.py > log.out &
nohup will automatically append the output from your script to a file named nohup.out
. By adding the > log.out
part of the command you can save the output to a different file of your choice.