This commit is contained in:
2026-01-12 15:25:30 -05:00
3 changed files with 65 additions and 0 deletions
@@ -0,0 +1,62 @@
# How to Run Long Jobs in the Background (Detach & Disconnect)
Since transcribing and translating videos can take hours, you likely want to start the job and then disconnect your SSH session or turn off your local computer without stopping the process on the remote server.
Here are the two best ways to do this.
## Method 1: Using `tmux` (Recommended for Wizard)
**Best for:** Using the interactive Wizard (`run_wizard_v2.py`) and seeing the progress bar when you reconnect.
1. **Start a new session:**
```bash
tmux new -s transcriber
```
*(This opens a new terminal "window" managed by the server)*
2. **Run the Wizard:**
```bash
./ai_transcriber_v2/run_wizard_v2.py
```
Answer all the prompts as usual until the job starts.
3. **Detach (Leave it running):**
* Press **`Ctrl` + `B`** together, release them, then press **`d`**.
* You will return to your normal prompt and see `[detached]`.
4. **Disconnect:**
You can now safely close your SSH terminal or shut down your computer.
5. **Reconnect Later:**
Log back into the server and run:
```bash
tmux attach -t transcriber
```
You will see the progress bar exactly where you left it.
---
## Method 2: Using `nohup` (Command Line Only)
**Best for:** Running automated scripts non-interactively. You CANNOT use the wizard with this method because you can't answer the prompts.
1. **Run the command directly:**
Use `main.py` with all arguments provided upfront.
```bash
nohup python3 ai_transcriber_v2/main.py /path/to/videos \
--lang English \
--model medium \
--prefer-local \
--embed \
--cleanup \
> job_output.log 2>&1 &
```
2. **Verify it's running:**
```bash
ps aux | grep main.py
```
3. **Monitor Progress:**
Since you can't see the progress bar, check the log file:
```bash
tail -f job_output.log
```
@@ -326,6 +326,9 @@ def main():
loaded_model = load_whisper_model(args.model)
# -----------------------
# Initialize Graceful Exit Handler
killer = GracefulKiller()
# --- Collect All Files ---
all_files = []
video_extensions = ('.mp4', '.mkv', '.mov', '.avi', '.webm', '.flv', '.wmv', '.m4v')