If a log file such as nohup.out is deleted in Linux while it is still the subject of a running job (and further input) what happens to the data?
#!/bin/bash while [ 1 ] do fortune done
# nohup ./script.sh &
This outputs the log to nohup.out by default.
# ./script.sh > nohup.out &
The question is; if nohup.out is deleted what happens? Is the file really gone assuming the job continues? What happens if script.sh generates enough data to fill a disk? Does this create a de-facto state of redirection to /dev/null?
By way of background I have found a process started previously in this method that can not be restarted for an extended duration but prior to that maintenance window it is my estimation the disk will fill. The situation will be avoided in the future, I am just curious as to what happens to an unlinked file still subject to redirection.