Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to recover soft links from a backup?

Hi all,


I have used rsync to backup my files from an iMac, and this iMac is gone.

Now, I moved all the backups to my new iMac.

I found that all the softlinks become binary files and are not working properly as a link.


more link_file gives:

"evt_a.fits" may be a binary file. See it anyway?

IntxLNK^"symbols....."


Is there any way to recover all these links?


Thank you very much in advance!

OS X Mavericks (10.9)

Posted on Nov 25, 2013 9:26 AM

Reply
7 replies

Nov 25, 2013 11:55 AM in response to KWQuestion

When I type "ln -l", it becomes something like this:

-rwxr-xr-x@ 1 username staff 132 Jun 22 2012 link_name

Then, no. You cannot easily recover the symlinks


At best you can either try to match up the file names with the original files and recreate the symlinks, or use a utility such as 'cmp' or maybe 'cksum' to figure out if 2 files are identical, and then replace one with a symlink to the other.

But this is all very manual, and subject to errors. Also if any of the symlinks were to directories, then you will have lots of real files under the directory and figuring out that you ONLY need to keep a symlink to the directory is a lot more owrk.


Next time you may want to use something like Carbon Copy Cloner to do this which will use rsync, but with all the desired Mac options (CCC can be used to copy a select set of files or subdirectories, and not just dup the entire disk; CCC is very flexible).

How to recover soft links from a backup?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.