3 ms·
Thanks, links saved. Then there is this method, but I guess that article refers to no redirection output. If in background or via cron, I always redirect. Bu
by jmclnx 11mo ago
Thanks, links saved.
Then there is this method, but I guess that article refers to no redirection output.
If in background or via cron, I always redirect. But this is for UN*X type systems with a tail that supports '-f'
$ prog > /tmp/log.txt 2>&1 &
Then
$ tail -f /tmp/log.txt
Just so happens, I actually used this the other day for a long running process on OpenBSD :)
- hmng 11mo agoIsn't that what tee is for? Like $ prog | tee /tmp/log.txt
- gosub100 11mo agoThat's if you start the process with advance knowledge that you'll want to tail the output and log it. Not if you want to view the output of an existing process
- hmng 11mo agoYes, but I was replying to the above, using redirection and tail -f.
- jmclnx 11mo agoWhen I submit a process to bg, I mostly use cron and I do not care about seeing output during runtime. So, tail suites my needs in the rare cases something unexpected seems to be happening.
- smcameron 11mo agoCan't you just read from /proc/pid/fd/0 ?
- irishcoffee 11mo agoThis was my first thought as well. I assume somehow I'm the dummy that doesn't understand the question.
- jmclnx 11mo agoOpenBSD does not have a /proc file system.