Page 1 of 1

Master file table unter Linux

Posted: Thu Mar 09, 2006 4:39 pm
by voessli
Hallo zusammen

ich habe vor mal endlich meinen "Root Ordner" also der Hauptordner gleich nach dem Domainname, von "www.mydomain.com/testdat/" in "www.mydomain.com/products/" umzubenennen. Aber unter diesem Pfad liegen ca. 40000 Dateien (natürlich verteilt auf viele Sub Ornder). Ich könnte mir vorstellen daß das System abstürzt wenn jeder Dateipfad unter Linux einzeln (absolut) registriert ist und jeweils neu gesetzt werden muß - Datenverlust soll auf jeden Fall vermeiden werden.
Sind die Pfade allerdings relativ gespeichert dann würden ja theoretisch nur die ersten Unterordner von "testdat" auf den neuen Überordner "products" umgestellt werden,

Kann mir da jemend einen Rat geben?

Posted: Fri Mar 10, 2006 12:01 am
by scott
Anyone know what this says?

Posted: Fri Mar 10, 2006 6:37 am
by breun
It's German. I don't speak German very well at all, but I believe he wants to change www.mydomain.com/testdat/ into www.mydomain.com/products/. Apparently there are approximately 40000 files in this directory. He imagines that the system will have some trouble updating all the absolute file paths, he doesn't want to lose any data. And then something about relative paths and the question if someone has any advice.

It sounds to me this would do the trick:

Code: Select all

mv testdat/ products/
(if testdat is an existing directory and products doesn't exist yet.)

But maybe I didn't understand quite enough of it.

Posted: Fri Mar 10, 2006 8:29 am
by scott
Thanks, for the translation!

Im guessing if its the code that points to that dir that needs to be changed, you could do it with a script:

for i in `find httpdocs/ -name \* -type f`; do
sed s/testdat/products/g $i > $i.new
mv -f $i.new $i
done

Posted: Sat Mar 11, 2006 2:43 pm
by voessli
Thanks! everything worked just fine .
Actually I was afraid that Linux could crash renaming a folder with a large number of files. But no, its not acting like Windows Explorer 8)

Btw, a Google Bot from Mediapartners has crawled my directory right when i go to the new Url. It is Opera 7.xx that sends data. Did you know that?