How to sync folders on Mac OS X with Dropbox using Symbolic Links

I decided to write this post because yesterday I was talking with some of my friends and we were discussing how amazing it is to have all (pretty much all) files stored in the cloud, thus, not having to worry about losing them because of a stolen laptop or a problem with the hard drive. Well, but some of them were complaining that the thing they hate the most is the fact that they have to put (move or copy) all the files and folders into the folder of the application they are using, i.e Dropbox, where you have to copy (in other words duplicate) all the files you want to share into the dropbox folder.

But I believe that the user should not have to adapt in order to use an application, it is the application that should be able to work for any type of user. I don’t know about you guys, but I have all my files and folders in a very well organized hierarchy that I don’t want to change it just because I want to share or have my files backed up.

The solution to this problem is not new, the Mac OS X that has its roots in UNIX has a very neat feature that is called Symbolic Link (or just Symlink), even Windows has something like this, you should look for “mklink“. The formal definition is “A symbolic link is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution“, if we translate this, it means that you don’t have a duplicated file, it is just one file that can be accessed from two or more different places.

You have to open Terminal and execute the command:
ln -s target_path link_path

or if you are already inside the link_path folder just execute the command:
ln -s target_path

You can see depicted in the images below that the commands are easy and now you have no excuse to have all your files and folders moved or copied (duplicated) into the Dropbox folder.

cd /Users/lsampaiolucky/Dropbox

cd /Users/…/Dropbox

ln -s /Users/lsampaiolucky/Scripts

ln -s /Users/…/Scripts

My folder's structure

Thank you for your time and feel free to leave any comments or questions.

Tweet about this on TwitterShare on StumbleUponShare on Google+Share on LinkedInShare on Facebook

2 Responses to “How to sync folders on Mac OS X with Dropbox using Symbolic Links”

  1. Keith Says:

    Hi

    Saw your video on Symbolic links.

    Just recently got the 1TB plan with drop box and have a 960 SSD drive on my mac.

    Will I be able to back up the whole drive to drop box then?

    I also have used mozy.com and they do a similar thing, but nowhere near the storage for the cost. And iCloud doesn’t do the whole computer.

    This is almost like having time machine on site and in the cloud using DB, yes?

    Can you also sync like this to DB and an external drive, so have symbolic sync to more than one folder and external device?

    Could you explain to me? Or make a quick video how to do the whole computer backup to DB please?

    Thanks!!

    Keith

  2. Luciano Sampaio Says:

    Hi Keith,

    I guess you’re right, if you have 1TB on dropbox you will be able to save all your data there and because dropbox saves the history of the files, it will be just like time machine. 🙂

    Sorry, but I didn’t understand your second question. Do you want to store all your data in a DB (Database) ? I found this video (https://www.youtube.com/watch?v=QByRKadjnEE) about Symbolic link and SSD.

    Best regards,
    Luciano Sampaio

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.