2
受け取っているアプリケーションを殺さずにLinux teeコマンドを終了する方法
Linuxマシンの電源が入っている限り実行するbashスクリプトがあります。以下に示すように開始します。 ( /mnt/apps/start.sh 2>&1 | tee /tmp/nginx/debug_log.log ) & 起動後、ps出力にteeコマンドが次のように表示されます。 $ ps | grep tee 418 root 0:02 tee /tmp/nginx/debug_log.log 3557 root 0:00 grep tee ログが特定のサイズに達すると、teeが生成するログのサイズを監視し、teeコマンドを強制終了する機能があります。 monitor_debug_log_size() { ## Monitor the file size of the debug log to make sure it does not get too big while true; do cecho …