Sync Any Folder On Your Mac With Dropbox Using Symbolic Links [Tip]
Symbolic links in Mac have been around for quite a while, and beyond doubt, they’ve been extremely useful. With the popularity of cloud storage services, particularly ones like Dropbox that sync files and folders from your hard disk directly to your online drive, it only makes sense that the usability scenarios for Symbolic Links will increase. We’ve previously covered apps that allow you to sync data between any two folders of your choosing, and a probable usage of such apps would be to sync an important folder on your drive to Dropbox (instead of manually copying all of its contents to your Dropbox directory). This can be particularly useful for automatically syncing app data or game saves with the cloud. Though, the problem with apps like these is that there is often a constraint to the number of folders you can sync. That is where Symbolic Links can come in handy. Read on for further details.
A symbolic link simply tells your Mac to save files to another folder that you’ve specified. As opposed to creating a shortcut or ‘Alias’, a symbolic link creates a copy of the file itself. To sync any number of folders between Macs, open Terminal and enter the following command
ln –s /users/path/to/folder/you/want/to/sync users/path/to/folder/you/want/to/sync/to
The command is basically ln –s, space, followed by the path to the folder you want to sync, another space, and then the path to a folder in Dropbox that you want to sync the file to.
What you’ve just done is create a folder that will always sync files to another folder in Dropbox. So far, you’ve synced a folder to Dropbox. Now, you need to sync it to the other Mac. The process remains the same, as does the command, but the syntax will change slightly. In the previous syntax, you entered the path to your folder on your disk first, followed by the path to a folder in Droopbox. What you need to do now is enter the path of the Dropbox folder that you just synced first, and then the path to another folder on your Mac. Please note that this second command is to be executed on the second Mac.
It is best to sync smaller files, since you might have limited storage in Dropbox, and also because, the bigger the file, the longer it will take to sync. Remember that you shouldn’t sync files of the same name simultaneously, as Dropbox will begin creating conflicted copies of it.
Thanks for the tip. Could you explain how to undo this symbolic link / automatic sync?
Hi,
Do you if there is a difference between those two scenarios:
1) I move the original folder in the Dropbox folder (for backup purpose, for example) and then create a symbolic link to the original place of the folder, so the structure or organization of the folders on my Mac remains the same.
2) I leave the original folders on my Mac just where they are and, instead, I create symbolic link into the Dropbox folder for each folders I want to backup.
In the first scenario, original folders are in the Dropbox folder (and thus synched and backup online).
In the second scenario, the Dropbox folder only contains symbolic links (pointing to the original folders that are still on my Mac).
Are those two scenarios equivalent?
Thanks,
P.
FYI, this also works on Windows with the mklink command.