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.
-------------- 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 :
http://lists.samba.org/archive/rsync/attachments/20071224/ffb0c6ca/attachment.bin