Skip to content

Instantly share code, notes, and snippets.

@andmax
Last active April 24, 2020 16:59
Show Gist options
  • Save andmax/3b01067194a7f6da2443d37f44b87d18 to your computer and use it in GitHub Desktop.
Save andmax/3b01067194a7f6da2443d37f44b87d18 to your computer and use it in GitHub Desktop.
1- The problem is to run a python script remotely using ssh
2- For a long time (days) and avoiding using $ screen
3- Preventing it to be killed when logging off: $ nohup
4- And redirecting stdout/stderr to a file: "&> file.txt"
5- Using python unbuffering to force writes: "python -u"
$ nohup python -u script_to_run.py &> std_out_err.txt &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment