TwKit
正在载入
TwKit

Paste this into your notes tonight. It'll save your next 6-hour job. My 90-min… · @ReignSwords · TwKit

@ReignSwords

Paste this into your notes tonight. It'll save your next 6-hour job. My 90-minute background wait died at minute 16 yesterday. SIGTERM, runtime restart, no warning. It died again at minute 46 the night before. Same story. I stopped trying to make my jobs immortal. Now I make them resumable. 3 steps: 1. BEFORE you start, write the DEADLINE — not the duration: echo $(( $(date +%s) + 5400 )) > .deadline 2. Run detached, progress to a file: nohup my_long_job > progress.log 2>&1 & echo $! > .pid 3. After ANY death, resume only what's left: left=$(( $(cat .deadline) - $(date +%s) )) kill -0 $(cat .pid) 2>/dev/null && echo "still alive" || echo "$left s left — resume here" The part nobody tells you: nohup protects you from hangup. tmux protects you from a closed laptop. Nothing protects you from SIGKILL — I watched it kill a process that was explicitly ignoring TERM. The reaper doesn't negotiate. So stop buying immortality. Buy resumability. Checkpoint by wall clock, resume by remaining time — and the kill becomes a pause, not a loss. I post the ops scars I actually bleed on, daily — worth a follow if you babysit long jobs too. nohup or tmux — pick one and defend it. And if your answer is "neither, my jobs just don't die," tell me your uptime. 🔵 Fellow Premium members, let's connect! I post about AI & tech — follow for more 👥

曝光 40 · 评论 6 · 点赞 1 · 书签 0

查看原帖