What are tmux and screen?
tmux: Terminal Multiplexer. It lets you create multiple virtual terminals within a single physical terminal window.
screen: Similar in concept to tmux, another popular option.
Benefits
Persistent Sessions: Even if you disconnect from your SSH session, sessions within tmux or screen persist. Your Python script will keep running.
Multiple Windows: You can split your terminal window into panes and switch between them, running different processes in each.
Reattachment: Reattach to a previous tmux or screen session whenever you log back in, and you'll find everything right where you left it.
How to use tmux (screen is very similar)
1 - Installation: If not installed, use your package manager:
sudo apt-get update
sudo apt-get install tmux
2 - Start a new session:
tmux new -s migrationeasy
3 - Run your script:
python your_script.py
4 - Press Ctrl B and then Ctrl D
5 - Log out
6 - Log in again
7 - Enable venv again
8 - tmux attach -t migrationeasy
Post #2805
295