quota command and rsync snapshots...

Antony Mawer fbsd-fs at mawer.org
Wed Nov 15 21:34:55 UTC 2006


On 16/11/2006 8:14 AM, Brooks Davis wrote:
> On Wed, Nov 15, 2006 at 03:39:56PM -0500, Ensel Sharon wrote:
>> So I have two questions:  given a directory that contains one current
>> backup and three snapshots (day.0 - day.4) what command can I run that
>> will show me the total _actual_ space used ?  du will not work because it
>> counts up each directory as if it used all of that space...
> 
> There isn't one that I know of.  Unless the volume is only used for this
> purposed (in which case df could be used) the only way to find this out
> would be to write a version of du that kept track of the inode of each
> hardlink and then didn't count it again.

du already does this - for instance, one of our backups snapshots:

$ du -h -d1 .
  73G    ./monthly
190M    ./2006-11-06_Mon
198M    ./2006-11-07_Tue
  14M    ./2006-11-08_Wed
  19M    ./2006-11-09_Thu
  11M    ./2006-11-10_Fri
9.6M    ./2006-11-11_Sat
9.6M    ./2006-11-12_Sun
  15M    ./2006-11-13_Mon
  12M    ./2006-11-14_Tue
  13M    ./2006-11-15_Wed
  73G    .

The 'monthly' folder here contains several snapshots (one per month), 
and then there's the daily snapshots.

This magic is all performed by linkchk() in /src/usr.bin/du/du.c.

--Antony


More information about the freebsd-fs mailing list