Page 1 of 1

Large scale file moving

Posted: Wed May 24, 2006 7:10 am
by s.dot
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()?

Posted: Wed May 24, 2006 8:42 am
by neophyte
How about doing it with Bash script rather than PHP?

Posted: Wed May 24, 2006 9:17 am
by s.dot
More comfortable with the browser than a shell doing something this important.