Sobes.tech
Middle

An alert came: disk space on /var is running out on the server. What will you do?

sobes.tech AI

Answer from AI

In case of a disk space shortage on /var, I would proceed as follows:

  1. Check current usage:
df -h /var
du -sh /var/*
  1. Identify large files and directories:
find /var -type f -size +100M
  1. Check logs: logs may occupy a lot of space, especially if rotation is not configured.

  2. Remove unnecessary files: old logs, temporary files, caches.

  3. Configure or check logrotate: to prevent future overflow.

  4. If space is critical: consider increasing the partition or moving data to another disk.

  5. Monitoring: set up alerts and automatic cleanup to prevent recurrence.