rsync du (was rsync delete)

Olivier Thauvin nanardon at
Mon Dec 24 02:38:54 GMT 2007

Le dimanche 23 décembre 2007, Matt McCutchen a écrit :
> On Sat, 2007-12-22 at 18:47 -0800, Jesse Thompson wrote:
> > Now I'm interested in a new possibility however. Using rsync
> > (connecting to a remote rsync server via rsync protocol) is there a
> > way to measure the size of a directory, kind of like du, without
> > having to transfer it?
> Yes.  Do a transfer of the directory in dry-run mode (so no data is
> actually copied) and pass --stats.  Look at the "Total file size"
> statistic, which is the total size of all regular file data and symlink
> target paths:

Tips, I manage a mirror ( if you're 
intesrested) and when I want to mirror a new distribution but need to know 
the size before taking final decision (the common question: will I have the 
space for it) I simple run:

rsync -avPHn rsync://server/share/ /tmp/a_non_existing_dir/.

Which produce somethings like:


sent 36799 bytes  received 437407 bytes  45162.48 bytes/sec
total size is 23422648587  speedup is 49393.40 (DRY RUN)

This simulate a real sync and give me size (about 23GB here).

BTW: my test for this mail end by:
rsync error: some files could not be transferred (code 23) at main.c(1535) 

Yet another unclean mirror with stupid files permissions probably :\

I do think we should provide a "good practice how to" for people providing 
mirror via rsync. A lot of them sucks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url :

More information about the rsync mailing list