using rsync to get filestats - Tools
This is a discussion on using rsync to get filestats - Tools ; Would it be more efficient to use rsync to get filestats instead of
using the 'find' command? I would like to know how big a directory is
on a filesystem, but this directory has millions of small files. I was
...
-
using rsync to get filestats
Would it be more efficient to use rsync to get filestats instead of
using the 'find' command? I would like to know how big a directory is
on a filesystem, but this directory has millions of small files. I was
wondering if rsync would be more efficient than find when using "-n"
options.
TIA
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
-
Re: using rsync to get filestats
On Mon, 2008-10-13 at 22:50 -0400, Mag Gam wrote:
> Would it be more efficient to use rsync to get filestats instead of
> using the 'find' command? I would like to know how big a directory is
> on a filesystem, but this directory has millions of small files. I was
> wondering if rsync would be more efficient than find when using "-n"
> options.
I assume that by "filestats" you mean stat(2) information for each file,
not aggregate statistics. My guess is that "find" would be faster than
"rsync -n" because it doesn't send the stat information to other
processes like rsync does. In addition, "find -printf" has a
configurable output format, while the "rsync --list-only" output format
is fixed.
Matt
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
-
Re: using rsync to get filestats
Great. Thanks matt. I was using the find method, but I want to find a
better way to get my directory sizes. I suppose a find -printf may
work.
If anyone else has suggestions please let me know.
TIA
On Mon, Oct 13, 2008 at 11:57 PM, Matt McCutchen wrote:
> On Mon, 2008-10-13 at 22:50 -0400, Mag Gam wrote:
>> Would it be more efficient to use rsync to get filestats instead of
>> using the 'find' command? I would like to know how big a directory is
>> on a filesystem, but this directory has millions of small files. I was
>> wondering if rsync would be more efficient than find when using "-n"
>> options.
>
> I assume that by "filestats" you mean stat(2) information for each file,
> not aggregate statistics. My guess is that "find" would be faster than
> "rsync -n" because it doesn't send the stat information to other
> processes like rsync does. In addition, "find -printf" has a
> configurable output format, while the "rsync --list-only" output format
> is fixed.
>
> Matt
>
>
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
-
Re: using rsync to get filestats
On Tue, 2008-10-14 at 00:28 -0400, Mag Gam wrote:
> Great. Thanks matt. I was using the find method, but I want to find a
> better way to get my directory sizes. I suppose a find -printf may
> work.
"find -printf" will give you the sizes of the directories (as lists of
entries) themselves. If you want subtree sizes, use "du".
Matt
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
-
Re: using rsync to get filestats
Thanks.
Does rsync use stat()? does find use stat() when running with printf?
I think the stat() is the most expensive part.
On Tue, Oct 14, 2008 at 12:30 AM, Matt McCutchen wrote:
> On Tue, 2008-10-14 at 00:28 -0400, Mag Gam wrote:
>> Great. Thanks matt. I was using the find method, but I want to find a
>> better way to get my directory sizes. I suppose a find -printf may
>> work.
>
> "find -printf" will give you the sizes of the directories (as lists of
> entries) themselves. If you want subtree sizes, use "du".
>
> Matt
>
>
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
-
Re: using rsync to get filestats
On Tue, 2008-10-14 at 07:31 -0400, Mag Gam wrote:
> Does rsync use stat()? does find use stat() when running with printf?
> I think the stat() is the most expensive part.
Rsync and "find -printf" both use stat(2).
Matt
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
-
Re: using rsync to get filestats
Thanks Matt. I suppose I could use rsync to know how big a directory
is then...right?
rsync --progress -avzL -n /source /foo
That should give me the total number of bytes to transfer
On Wed, Oct 15, 2008 at 3:03 PM, Matt McCutchen wrote:
> On Tue, 2008-10-14 at 07:31 -0400, Mag Gam wrote:
>> Does rsync use stat()? does find use stat() when running with printf?
>> I think the stat() is the most expensive part.
>
> Rsync and "find -printf" both use stat(2).
>
> Matt
>
>
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
-
Re: using rsync to get filestats
On Sat, 2008-10-18 at 20:55 -0400, Mag Gam wrote:
> Thanks Matt. I suppose I could use rsync to know how big a directory
> is then...right?
>
> rsync --progress -avzL -n /source /foo
>
> That should give me the total number of bytes to transfer
That will work, but --progress seems to be pointless on a dry run, and
you might like to pass --stats to get some additional information.
Matt
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html