Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Migrating thousands of user home, profile, apps and groups directory paths

Reply
Thread Tools

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

 
 
Jiz
Guest
Posts: n/a
 
      08-20-2005
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

 
Reply With Quote
 
 
 
 
Jiz
Guest
Posts: n/a
 
      08-20-2005
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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
virtual directory and hyperlink file path issue (listed and linked paths don't match) Jim in Arizona ASP .Net 0 05-08-2009 05:47 PM
migrating web application to VS2005 (.NET 2.0) (xposted in a few other groups) ndrw_cheung@yahoo.ca ASP .Net 0 08-10-2007 12:51 PM
Paths, gentleman, paths Ohad Lutzky Ruby 2 11-07-2006 02:15 AM
Migrating apps from NT4 to Windows 2000 Server Graham Carr ASP General 2 11-25-2004 02:59 PM
Convert between Windows style paths and POSIX style paths Noah Python 5 07-11-2003 09:25 PM



Advertisments