kulls has asked for the wisdom of the Perl Monks concerning the following question:

Greetings,
I'm going to automate my manual approach through perl script.so i need all of your suggestions before to start.
Basically i have a dir structure like
dir1/a dir1/b dir1/c dir1/d
I need to divide this /dir1 into n parts which is as same structure like /dir1 and it's become
dir2/a dir2/b dir2/c dir2/d dir3/a dir3/b dir3/c dir3/d

I can specify the limit of the folders if required. (assume that all files are zipped(.gz) in the a,b,c,d folders respectively.)
How well i can customize the script in order to reuse it?.
Is there any related modules available in the CPAN?.
Shall i do it like a utility script or do it as a module.please give your thoughts for the better approach.

Update:
As McDarren suggest i just explain the issue .

You haven't explained your problem very well, and so people have to try and second-guess before they offer any advice

i'm processing around 50GB data every 60 days.Once i processed, then i'll split the data into several directories which is normally a DVD image size.so it's take a lot of time, data loss and often mess-up that leads to post the question here.

You haven't shown that you've made any effort to solve the problem yourself

Currenly i have a script that will check and display each subfolder size, so that i can create the multiple folders and move the data manually.
I need to get the suggestion as much as possible here. before i'm going to start instead blindly.
-kulls

Replies are listed 'Best First'.
Re: Directory splitter
by McDarren (Abbot) on Jan 10, 2006 at 11:33 UTC
    Hi kulls,

    I suspect that there are two main reasons why you haven't yet had any replies to this question, and also why you've received a few downvotes.

    1. You haven't explained your problem very well, and so people have to try and second-guess before they offer any advice.
    2. You haven't shown that you've made any effort to solve the problem yourself.

    Personally, I passed on your question when it was first posted because of the first reason, and I didn't want to waste my time (and yours) giving you an answer that probably wasn't what you were after anyway.

    Whilst most people will make allowances regards the above for new or first time posters, they tend to be a little less tolerant if the OP has been around for a while and should know better.

    Please have a read of How (Not) To Ask A Question and I know what I mean. Why don't you? if you haven't already.

    Cheers,
    Darren :)

Re: Directory splitter
by svenXY (Deacon) on Jan 10, 2006 at 13:47 UTC
Re: Directory splitter
by svenXY (Deacon) on Jan 10, 2006 at 11:44 UTC
    Hi,
    to me it is not really clear what you are after. You say that "All files are zipped(.gz) in the a,b,c,d folders respectively". What do you mean by that? On what rule do you make the decision which file to put where? Or is your only intention here how to create the folder structure? Are there more directories below a,b,c,d?
    Regards,
    svenXY
Re: Directory splitter
by svenXY (Deacon) on Jan 10, 2006 at 13:24 UTC
    Hi,

    "...50GB data every 60 days.Once processed, I split the data into several directories which is normally a DVD image size..."


    OK, so you want to fill dir1/... with up to 4.7GB of data from a given directory, then start the next "DVD" aka dir2, fill it up again and so on? Is that what you are after?

    "...script that will check and display each subfolder size..."

    this sounds like something to start with. Do you want to share your snippets?
    The problem will be to properly fill up the directories. Another question: why does it need to always be the same folder structure. I mean, you could start with dir1 and just fill files into dir1/a or so until you either hit the 4.7GB limit or have no more files in a, then move to b and so on. If d is "full", then move to dir2/a and so on...
    Sounds reasonable?

    Regards,
    svenXY