Master file table unter Linux

General Discussion of atomic repo and development projects.

Ask for help here with anything else not covered by other forums.
voessli
Forum User
Forum User
Posts: 11
Joined: Tue Nov 22, 2005 9:22 am

Master file table unter Linux

Unread post 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?
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

Anyone know what this says?
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post 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.
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post 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
voessli
Forum User
Forum User
Posts: 11
Joined: Tue Nov 22, 2005 9:22 am

Unread post 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?
Post Reply