This question already has an answer here:
- Can a file be retrieved by its inode? 4 answers
I've started a long running process with nohup and redirected it's output to a log file
nohup ./bin/zkServer.sh start-foreground > /usr/local/myuser/logs/zkout.log 2>&1 &
I accidentally deleted the
zkout.log file so now I can't see any output from the command.
I'm not interested in recovering the data, but I am wondering if there is a way to 'reattach' the stdout from my long running process to the file without having to kill/restart?
I tried just recreating
/usr/local/myuser/logs/zkout.log but that doesn't work.
I also looked at this question: recovering deleted file held open by apache? but that is talking about recovering the content of the deleted file (which I don't care about). However, I do see the broken link in /proc/$procid/fd; could I just update that link to point to the new file?