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 (http://distrib-coffee.ipsl.jussieu.fr 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:

[...]
alpine/v1.7/usbdrive/alpine-1.7.9-i386.tar.gz.sha1
alpine/v1.7/usbdrive/syslinux.exe

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) 
[generator=3.0.0pre7]

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.

Attachment: signature.asc
Description: This is a digitally signed message part.

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to