On Tue 08 Mar 2016 17:57:10 NZDT +1300, Criggie wrote:

> I'm sure this can be optimised, but how's this for some dirty hackery.

Dirty, yes, clever, not so sure. I don't think I'd be game to run that
on one of my filesystems. Checking for empty lines would be essential,
and gawk is much better at splitting the input than xargs -n3!
You could also program this in bash, efficiency is not your main
problem, and it had the advantage of being reusable.

Personally I'd run cp -al to-be-sorted some-other-place befre running
anything else. Then I'd think about short scripting that is able to
verify whether the linking took place correctly. E.g.
  find -type f | xargs md5sum
must produce identical output before and after.

To avoid getting into the same situation again, look at rsync
--dest-dir. That's the secret ingredient in rsnapshot.

Your dirty method destroys directories lastmod stamps, I always get very
irate with that kind of thing.

> And the script merely spits out shell commands which are then executed.

Good.

> So testing it is just running the command without the backticks of
> execution.

Crikey! I wouldn't risk that. Pipe into sh -s instead.

Volker

-- 
Volker Kuhlmann
http://volker.top.geek.nz/      Please do not CC list postings to me.
_______________________________________________
Linux-users mailing list
Linux-users@lists.canterbury.ac.nz
http://lists.canterbury.ac.nz/mailman/listinfo/linux-users

Reply via email to