Migrating thousands of user home, profile, apps and groups directory paths

Discussion in 'Perl Misc' started by Jiz, Aug 20, 2005.

  1. Jiz

    Jiz Guest

    Hi all, I am trying to create a function to determine the lowest level
    directory that I need to backup (robocopy) to correctly move the files
    from one volume or server to another. I have created a list of
    locations in a text file, and for the following examples, I would like
    the function to return only 'E:\GRUPOS'.

    E:\GRUPOS\GRUPALES
    E:\GRUPOS\GRUPALES\POL√ĚTICAS Y PROCEDIMIENTOS
    E:\GRUPOS\SCANNER
    E:\GRUPOS\SE_GENERAL
    E:\GRUPOS\SEBA_SAP
    E:\GRUPOS\SEBA_SAP\MANUALES SAP
    E:\GRUPOS\SEBA_SAP\MANUALES SAP

    In fact I want to create a function that given a list it would return
    an array of these 'base paths' that if I were to back them up, would
    contain all the data directories I need. Something like:

    $ret = find_base_paths(@dir_list, \@base_paths);

    I have the feeling that this is quite simple, and probably only a
    string based solution, but I cannot quite fathom how to do this. Here
    is a subset of paths from one of the 800 production servers;

    E:\BCKPIVOTAL
    E:\FREEHD
    E:\GRUPOS\GRUPALES
    E:\GRUPOS\GRUPALES\POL√ĚTICAS Y PROCEDIMIENTOS
    E:\GRUPOS\SCANNER
    E:\GRUPOS\SE_GENERAL
    E:\GRUPOS\SEBA_SAP
    E:\GRUPOS\SEBA_SAP\MANUALES SAP
    E:\GRUPOS\SEBA_SAP\MANUALES SAP
    E:\INTERFACES
    E:\PROFILESSA
    E:\SAH_PROFS
    E:\SETUP
    E:\TS_PROFS
    E:\USERS\ACOSTCE1SAP
    E:\USERS\ADMIN
    E:\USERS\ALVIGMA1SAP
    E:\USERS\CAMPACE1
    E:\USERS\CANOVCH1
    E:\USERS\CANOVCH1SAP
    E:\USERS\CANTARJU
    E:\USERS\CAROSSJO
    E:\USERS\CASTRCE1
    E:\USERS\CAVIGRO1SAP
    E:\USERS\CERESJA1
    E:\USERS\CERESJA1SAP
    E:\USERS\CUETOGU1SAP
    E:\USERS\DIAZSU1
    E:\USERS\DIRIEGU1
    E:\USERS\ESPINMA1SAP
    E:\USERS\FENOGAL1SAP
    E:\USERS\FERELFA1
    E:\USERS\FERNAMABSAP
    E:\USERS\GALEAGU1
    E:\USERS\GARCIGU1
    E:\USERS\GASTAES1
    E:\USERS\GENNANI1
    E:\USERS\GIORDOS1SAP
    E:\USERS\GIOSUGU1
    E:\USERS\HERRMRI1SAP
    E:\USERS\JIMENJU4
    E:\USERS\KAPELSE1
    E:\USERS\KENNYJU1SAP
    E:\USERS\KIEKEJU1SAP
    E:\USERS\LAMENMA1
    E:\USERS\LAUDOPA2
    E:\USERS\LAZARJO1SAP
    E:\USERS\MANCUED1
    E:\USERS\MARTICA2
    E:\USERS\MARTICA2SAP
    E:\USERS\MAYORPA1SAP
    E:\USERS\MORICSE1
    E:\USERS\NARDODI1
    E:\USERS\PAOLUDA1
    E:\USERS\PAOLUDA2SAP
    E:\USERS\PARODPI1
    E:\USERS\PEREZFR1
    E:\USERS\PETTIHE1
    E:\USERS\PITTAMA1
    E:\USERS\PORTEEZ1
    E:\USERS\REYJU1
    E:\USERS\RODRIZU1
    E:\USERS\ROMERMA1SAP
    E:\USERS\RUGERPE1
    E:\USERS\SALVAAR1
    E:\USERS\SALVAAR1SAP
    E:\USERS\SCALASE27
    E:\USERS\SESTAES1
    E:\USERS\SOUZAMA1SAP
    E:\USERS\SUARESE1
    E:\USERS\T105826
    E:\USERS\T106106
    E:\USERS\T134596
    E:\USERS\T171773
    E:\USERS\T182567
    E:\USERS\T196511
    E:\USERS\U119833
    E:\USERS\U131999
    E:\USERS\U132006
    E:\USERS\U132013
    E:\USERS\U164129
    E:\USERS\U169246
    E:\USERS\U176246
    E:\USERS\U176533
    E:\USERS\U176540
    E:\USERS\U177758
    E:\USERS\U181454
    E:\USERS\U189231
    E:\USERS\U196518
     
    Jiz, Aug 20, 2005
    #1
    1. Advertising

  2. Jiz

    Jiz Guest

    Re: Migrating thousands of user home, profile, apps and groups directory paths

    Aha! Thanks Jim, that is a good idea using a hash, that would do a kind
    of SQL 'distinct' on the paths...I still can't 'see' a solution
    though...Because D:\DATA, and E:\DATA would be different, and should be
    treated differently. Maybe if make the hash key the form
    DRV:\\FIRST_LEVEL_DIR or something?
     
    Jiz, Aug 20, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brad
    Replies:
    1
    Views:
    1,143
    Roedy Green
    Jul 19, 2005
  2. Noah
    Replies:
    5
    Views:
    795
  3. Replies:
    0
    Views:
    285
  4. Graham Carr

    Migrating apps from NT4 to Windows 2000 Server

    Graham Carr, Nov 25, 2004, in forum: ASP General
    Replies:
    2
    Views:
    120
    s_m_b
    Nov 25, 2004
  5. Ohad Lutzky

    Paths, gentleman, paths

    Ohad Lutzky, Nov 6, 2006, in forum: Ruby
    Replies:
    2
    Views:
    204
    David Vallner
    Nov 7, 2006
Loading...

Share This Page