Operating System - Linux
1753893 Members
7754 Online
108809 Solutions
New Discussion юеВ

Re: Tracking filesystem growth on RedHat

 
SOLVED
Go to solution
frederick hannah
Super Advisor

Tracking filesystem growth on RedHat

I know this is a reach, but is there a command or script that can reveal the growth of a filesystem over a period of time? I would like to track the growth of a filesystem over a 3 month period. The ser
4 REPLIES 4
Patrick Wallek
Honored Contributor
Solution

Re: Tracking filesystem growth on RedHat

The easiest thing I can think of is to use cron to execute something like 'df -h /filesystem >> /root/filesystem-usage'

Note that the '>>' is important to append to the output file.

Run that line periodically (once a day, twice a day, whatever you need) and you'll have your ongoing record.
frederick hannah
Super Advisor

Re: Tracking filesystem growth on RedHat

Thanks for the quick response, but is there a way to "go back" and retrive filesystem growth over a period of time? I know its a long-shot but I had to ask.
Matti_Kurkela
Honored Contributor

Re: Tracking filesystem growth on RedHat

The filesystem does not store usage history statistics about itself. If you need such statistics, you'll need to set up something that periodically stores statistics about the current usage levels, and then identify the trends using the stored statistics.

But as you obviously haven't set up such a thing yet, you cannot get information about the past 3 months that way now.

Instead, look at your past backups. (You *do* have multiple full backups stored, right?)

The size of a full backup of a filesystem should have a fairly direct relation to the size of the data in the filesystem. If you're compressing your backups, the relation of (filesystem size:backup size) won't be 1:1, but as long as the type of the data doesn't change, the relation should remain fairly constant (N:1), so a trend should be identifiable anyway.

MK
MK
frederick hannah
Super Advisor

Re: Tracking filesystem growth on RedHat

Thanks. You have both helped tremendously.