Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Are there any common Linux tools that track disk space over time, not just a filesystem overall, but for example, so I could easily see which directory trees swelled up and shrunk historically? The problem happens on servers which seem to keep hitting 0 free space despite routine house-cleaning of cache and tmp files, logs etc. I already use tools like df, du and lsof often and schedule at jobs to find aged files over a certain size/type when low water-marks are hit, etc.

Preferably a Debian/Ubuntu package.

share|improve this question
    
I take it you want something more user-friendly than du -s running in cron, right? –  peterph Apr 4 '13 at 11:29
1  
I think they're wanting a historic calculation of disk space utilization like what you'd get for CPU or I/O utilization doing a "sar" command. –  Joel Davis Apr 4 '13 at 13:15
add comment

1 Answer

Couple things would make the creation of a tool like this problematic:

  1. The kernel doesn't keep directory or file-specific file size histories (like it does with memory usage, I/O activity, or CPU time), so anything written would have to be in userspace.
  2. Even if something were written using inotify or something, on busy servers the overhead of a user space daemon recording the output of "du -s" after every file change would be huge. On less than busy servers you probably wouldn't have this concern. So you run into the situation where the tool is only useful to the people who can't afford its overhead.
  3. Network Monitoring daemons such as Zabbix or Nagios contain some primitive disk utilization monitoring (of whole filesystems) with histories that serves the needs of most admins in this regard. Needs beyond that are typically break/fix where you go into the filesystem in question and check to see what's taking up the space after the fact (using network monitoring to do proactive warning of possible issues).
  4. If you really really need to know this and waiting for your proactive warnings to notify you when it's happening again (so that you can check it out) isn't an option, you can ultimately write a script to monitor the directories you're concerned about. (basically recording the output of "find /path/to/dir -type d -exec du -sh {} \;" in some way that's going to be easy for you to review).

So there's no real demand for creating a user space tool to do this since it would be hard to do correctly and existing solutions get you pretty close to the ideal.

Short Answer: I'm not aware of such a tool, but it makes sense there wouldn't be.

share|improve this answer
    
It's within my reach to hack together user-space scripts to eg. record periodic du snapshots from cron of all/some directories, store them in SQL/CSV for later analysis to narrow down where storage is being consumed when, and make friendly reports to pinpoint this. With ability to zoom into the dir hierarchy, one hopes. But that's time-consuming and I'm hoping something similar exists, even if imperfect (hardlinks etc.). –  Marcos Apr 4 '13 at 16:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.