Reputation: 379
I have a nohup process running on my FreeBSD 8.4 box. Initially I was looking at nohup console messages output through
tail -f nohup.out
But I accidentally deleted nohup.out file. How can I access the console messages now ?
Upvotes: 3
Views: 881
Reputation: 677
Its pretty easy actually.
nohup my-long-process.sh &
Or if you remember it (very likely), just go to the next step.ps -ef|grep my-long-process
2919
in this example./proc/2919/fd
. Here 2919
is the PID you got from the ps
command above.ls -l /proc/2919/fd
, you will see a link (or two) called 1
, 2
etc that point to your deleted
file. In fact, the name of the destination file will be /path/to/your/nohup.out (deleted)
.tail -f tail -f /proc/2919/fd/1
.Oh, and if you want to see what you missed, you can less
that file with less /proc/2919/fd/1
Upvotes: 8