'tee' 在什么情况下会删除它正在写入的文件?

On what occasion does 'tee' deletes the file it was writing on?

bash4.2,centos


脚本

#!/bin/bash

LOG_FILE=$homedir/logs/result.log
exec 3>&1
exec > >(tee -a ${LOG_FILE}) 2>&1
echo
    
end_shell_number=10

for script in `seq -f "%02g_*.sh" 0 $end_shell_number`; do
    if ! bash $homedir/$script; then
        printf 'Script "%s" failed, terminating...\n' "$script" >&2
        exit 1
    fi
done

它基本上贯穿 00 到 10 号子外壳,并将所有内容记录到 LOG_FILE,同时也在标准输出上显示。

我看着日志堆满 tail -F ./logs/result.log, 在日志文件突然被删除之前,它一直运行良好。

子 shell 与文件描述符和日志文件无关。他们通过 ssh 命令远程重启 tomcat。


问题:
tee 成功写入日志文件,直到文件被删除,日志记录从那时起停止。
tee 中是否有文件大小限制或超时? tee 是否有删除文件的已知行为?

On what occasion does 'tee' deletes the file it was writing on?

tee 一旦文件开始写入,就不会删除或截断文件。

Is there a filesize limit or timeout in tee?

没有

Is there any known behavior of tee that it deletes a file?

没有

请注意,文件可以删除,但进程 (tee) 仍会写入打开的文件描述符,但文件将不可访问(参见 man 3 unlink)。