Let’s say I start an SSH session on my laptop and have things going but have to restart my laptop for some reason, how can I access that session on the DietPi itself?
Like right now I have an install going over SSH on my laptop but want to pick it up on the Dietpi.
Screen is absolutely great, must-have from my side. If there wasn’t so much other topics on DietPi dev, I would have added it already, from my side as default. So it’s on my minds list at least.
You can start some long task there, and if your SSH connection breaks or you want to drink coffee, the task will go on and you can reattach at any time.
Only downside was, that you can’t scroll up the terminal output by default with mouse wheel. But I found a solution for this:
cat << _EOF_ > ~/.screenrc
# Make screen windows scrollable
termcapinfo xterm|xterms|xs|rxvt ti@:te@
# Add information status line to screen windows
caption always "%{Gk}DietPi Screen | $LOGNAME@%H | %LD %d.%m.%Y %c | Load: %l | %-Lw%{kG}%n%f*%50> %t%{-}%+Lw%<"
_EOF_
The last line adds some kind of status line. Needs visual tuning, but the ugly code part on the right side actually lists all active screen windows and highlights the one you are attached. So if you want to have e.g. some files open in parallel or parallel running jobs, it helps a bid to keep overview.
nohup some_command > output.log &
then i can close the session
to check if the process is still running: jobs -l
or to check status: tail -f output.log