In my workplace, I've inherited the responsibility of managing a web server. It's a CentOS Linux virtual machine, running on Amazon AWS EC2. Alongside serving web pages, there is a pile of scheduled tasks, background processing and database operations that happen.
Just now I was manually running a Bash script that calls Oracle SQL*Plus, which reads a SQL script with a load of UPDATE statements and calls to refresh materialized views. Maybe none of that is relevant, but I wanted to give some context.
The Bash script writes output to a log file in /tmp
, and I was using the command tail -f output.log
to monitor the output. It was running for a long time - maybe 20 minutes - with output slowly appearing in my terminal, but then I got a message: tail: output.log: file truncated
and the Bash script stopped running. The log file exists in /tmp
but it has size 0. I was hoping to go through the log file in detail to see what DB errors were reported, so I could fix things.
My question is, what could cause this file truncation to happen? I don't think the file itself was very big - only something like 200 lines. This is all kind of new to me, and I don't really know where to start, or what to suspect as potentially problematic.
cat /etc/os-release
tells me CentOS Linux version 7 (Core). If I rundu
in/tmp
it says that 17MB is used. If I rundf -Ph .
it says that 10GB is used and 10GB is available. I don't know about systemd or its/tmp
cleaner, but there are files in/tmp
with timestamps of more than a week ago.