Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know I can use df to get a summary of disk usage right now.

I can use du to break down into the detail of how the disk is being used.

The problem is I can only see this information for today.

If I wanted to map a trend I would have to write a script that takes the output of those commands and writes it to a file / log. Which I could later analyse. I was wondering if there is any tool or programs that can do this, that are already included in most Linux distros. Do I have to look at a more heavy weight monitoring solution.

share|improve this question
up vote 4 down vote accepted

It depends on your needs. You can use cron to run e.g. the following as a simple solution for your problem:

df > /path/to/some/directory/df-$( date +%Y%m%d-%H%M%S )

Run crontab -e to open your user's crontab file. Add the following new line to it:

0 0 * * * df > /path/to/some/directory/df-$( date +%Y%m%d-%H%M%S )

This will execute df (optionally with arguments) every day at midnight and write its output to a timestamped file.

From these files, you can then assemble the usage information over time.

share|improve this answer
Of course, if you want fancy graphics for your manager, that probably won't do... – Daniel Beck Jan 11 '12 at 8:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .