1

I have a VPS with 120GB of total disk capacity. In the past couple of months, our usage surged and since we have been within 95% of used disk space.

Anyhow, a couple of days ago, I've identified large logs files that were really not necessary and I removed them which bought me around 11 GB of space. The system showed 16GB of free space. But this morning, something interesting happened - I checked disk space only to find 26GB free. I can only assume that those were some tmp files.

Is there a way to determine which files were deleted?

Jovan Perovic
  • 143
  • 2
  • 3
  • 14

1 Answers1

1

Understanding exactly what is happening to your free space could involve a few methods:

  • Previously recorded sizes such as with ncdu -o or any previous backups, running that again, and comparing.
  • Any logs from log purge scripts. However, this logging may not exist, it is not typical to run for example logrotate --verbose.
  • Guessing what was purged based on the oldest log files still there, when the purge is scheduled, and any recorded state like /var/lib/logrotate/logrotate.status.
  • Evidence of closed deleted file handles. Unlink a log file that is still open, and the free space is not recovered until closed. Which might happen on a certain signal to the process, or restarting it.
  • Identifying any not-log purges that may have happened, such as purging temporary files, caches, or reducing the size of databases.
John Mahowald
  • 32,050
  • 2
  • 19
  • 34
  • Thank you, you were right. I did have log rotation in place and it rotated some rather large files. Why did log rotation allow those files to become so big... well... that is whole another question :) – Jovan Perovic Jun 26 '20 at 16:09