Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Find symlinks, or what should be symlinks...



In setting up my new notebook, I copied over the big Projects directory
tree. My first try (using rsync, via a NAS disk) had problems
(everything had the 'x' permission set, and symlinks didn't get copied).

So, I set up sshd, and "scp -rp"-ed the directory tree. It took a while
longer than expected, and I realized it must have followed all the
symlinks into a "data" directory tree, and copied them as files. Not
major, I thought, there are just a few, I can move it around afterwards
(and it saves having to copy the data directory...).

But, poking around, I realize there were lots of symlinks. E.g. a
directory containing library files:
   xxx.1.2.3.so
   xxx.so

These are now both 2MB files, instead of one being a link to the other.

How would you fix this?

I could delete and start again, using rsync, with it set to keep
symlinks within the same disk).

...Would rsync, to the existing tree, replace xxx.so above with a
symlink, automatically? If so, not starting again and instead just
running rsync, might be perfect?

Or I could run some clever bash script (??) to find all symlinks on the
old machine. Then I have a list of what I need to fix manually.

Or I started wondering if there is a tool to hunt for duplicate files
and sub-directories in a directory tree? That might give me an optimum
list of what should be symlinked, and at least I'd then know the size of
the problem.

Darren



-- 
Darren Cook, Software Researcher/Developer
My new book: Data Push Apps with HTML5 SSE
Published by O'Reilly: (ask me for a discount code!)
  http://shop.oreilly.com/product/0636920030928.do
Also on Amazon and at all good booksellers!


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links