That sounds like a variation on the Knapsack Problem.

A typical, basic, example of the Knapsack Problem is this:

Suppose a burglar finds a lot of valuable goodies, more than he can carry, and he has limited space in his knapsack. What should he take, and how should he stack it, to maximize his loot?

The algorithm library (see Google) has a lot to say about it, in many variations, too, but let me tell you: it's probably harder than you think. Think of each master directory as a knapsack that can hold 195MB, and you have to devide the loot (your directories) among them.

And my advice is to do this in the abstract: build a large datastructure with the data on the directories, in particular their sizes, fugure out how to stack them, and only then start to move things around, as a final step. And only after you verified the solution is acceptable to you — you never know with bugs, otherwise you might lose valuable files.


In reply to Re: split directories with sizes by bart
in thread split directories with sizes by prasadbabu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.