Closed gzagatti closed 1 year ago
Perfect! This is what I was looking for.
For future records, I can run an ipython as:
> dtach -A /tmp/foo script -f -O foo.log -c "ipython"
All STDOUT is written to foo.log
. In case I get disconnected (say from a ssh session), I can reconnect to the ipython with:
> dtach -a /tmp/foo
If the script is not interactive, I could also use nohup
without dtach
.
> nohup python my_script.py > foo.log &
> disown
If using script
or nohup
, I can follow the STDOUT with:
> tail -f foo.log
I was wondering if it's possible to capture the STDOUT from dtach socket to a log file. The idea is to capture all the session into a log file that I can analyse later.
I have tried playing with
socat
but could not find the correct incantation. Is that even possible?