Skip to content

Instantly share code, notes, and snippets.

@rileypeterson
Created February 16, 2021 08:37
Show Gist options
  • Save rileypeterson/043a611f9c0f7376158036811ad2b20f to your computer and use it in GitHub Desktop.
Save rileypeterson/043a611f9c0f7376158036811ad2b20f to your computer and use it in GitHub Desktop.
Execute remote scripts via ssh and tmux (detached). This is much more convenient than nohup, etc. and it lets you actually re-attach to session if you want to ssh in and check on it :)
ssh username@your.machine.address -t 'tmux new-session -d "sleep 20"'
# or change "sleep 20" --> "python my_time_consuming_python_script.py"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment