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:
- Check current usage:
df -h /var
du -sh /var/*
- Identify large files and directories:
find /var -type f -size +100M
-
Check logs: logs may occupy a lot of space, especially if rotation is not configured.
-
Remove unnecessary files: old logs, temporary files, caches.
-
Configure or check logrotate: to prevent future overflow.
-
If space is critical: consider increasing the partition or moving data to another disk.
-
Monitoring: set up alerts and automatic cleanup to prevent recurrence.