On 01/05/10 04:32, Kevin Kofler wrote:
Adam Jackson wrote:
> find / -xdev -type f | while read i; do
> cp $i /tmp/tmp
> rm $i
> mv /tmp/tmp $i
> done
I presume that cp should be cp -p? And I guess it would be better to do a mv
-f rather than rm + mv, otherwise you're going to have trouble when you hit
/bin/mv. :-) And of course this needs to run as root.
> Obviously, don't actually run that.
Well, are there any other caveats than the ones I listed above?
The cp/rm/mv file replacement method is only suitable for once off replacements
as there are processes started per file. Even for single file replacements
there are considerations other than performance:
http://www.pixelbeat.org/docs/unix_file_replacement.html
Better do this sort of thing to/from another partition (that supports
all the same file attributes), with tar,rsync,...
cheers,
Pádraig.