Finding the size of directory with multiply hardlinked files

Roberto Ragusa mail at robertoragusa.it
Fri Mar 14 17:46:15 UTC 2008


Dean S. Messing wrote:
> Say backup_A was created first.  If I do `du_true
> backup_A' I shd. see its size.  Now I delete some files
> in "/dir_to_back_up" and create some other new files.
> Now I create "backup_B" with the above rsync command.  I'd
> like for my mythical `du_true' to compute the
> incremental change in size from backup_A to backup_B.

du -s -c backup_A backup_B

I use that to do exactly what you are want (hardlinked backups).

The first result is the space occupied by A, the second
result is the _additional_ space occupied by B.

You can also go beyond two dirs.

du -s -c backup_A backup_B backup_C backup_D

But I find this one more useful:

du -s -c backup_D backup_C backup_B backup_A

because the result

10G backup_D
600M backup_C
300M backup_B
400M backup_A

tells me that if I delete the oldest backup
I free 400M, and I can free 700M if I delete
the two oldest backups, etc.

You can play with something like:

du -s -c `ls | sort -r`

Best regards.
-- 
    Roberto Ragusa    mail at robertoragusa.it




More information about the fedora-list mailing list