Large scale file moving
Posted: Wed May 24, 2006 7:10 am
There's about 5000 directories in one of my directories, and each one of those 5,000 directories could contain up to a couple hundred photos.
Currently they're stored as the username
/user1/
/user2/
/user3/
etc.
I'm going to be renaming them to the users id, then moving them to a new location
newdir/1/
newdir/2/
newdir/3/
And then transfering the contents.
What's the best way to do this?
Obviously a gigantic loop comes to mind, but I have not had good experiences with huge loops. =[
What about taring the directory, and untaring to the new location, and just running a script to rename? Rename and move at once? copy() or rename()?
Currently they're stored as the username
/user1/
/user2/
/user3/
etc.
I'm going to be renaming them to the users id, then moving them to a new location
newdir/1/
newdir/2/
newdir/3/
And then transfering the contents.
What's the best way to do this?
Obviously a gigantic loop comes to mind, but I have not had good experiences with huge loops. =[
What about taring the directory, and untaring to the new location, and just running a script to rename? Rename and move at once? copy() or rename()?