SEARCH

How-To Geek

How to Sync Any Folder to the Cloud With Symbolic Links

how-to-sync-any-folder-to-cloud-storage

The big cloud storage services — Dropbox, Google Drive, Microsoft OneDrive, and others — all have the same problem. They can only synchronize folders inside your cloud storage folder. But there’s a way around this limitation: symbolic links.

Symbolic links are extremely useful for synchronizing any folder on your PC. You may want to synchronize some sort of configuration file that has to be in a specific location on your PC, for example.

Symbolic Links 101

Windows, Linux, and Mac OS X all have integrated tools for creating symbolic links. A symbolic link is just a “pointer” that points at a folder elsewhere. Programs on the computer see the link as if if it were the same as the real folder or files.

For example, let’s say you wanted to synchronize all the files in C:\Stuff with Dropbox, but you still want them in C:\Stuff. You could create a symbolic link in the Dropbox folder that points to C:\Stuff and Dropbox would synchronize everything inside the C:\Stuff folder.

That’s the theory, anyway. In practice, many cloud storage services no longer work properly with symbolic links. We can still use symbolic links in reverse, though. In our example, we’d move the entire C:\Stuff folder to Dropbox’s folder. We’d then create a symbolic link at C:\Stuff pointing to the Dropbox\Stuff folder. Dropbox would synchronize the files in the folder and the programs that need the folder at C:\Stuff would function normally. We first covered this solution when we looked at how to synchronize any folder with OneDrive on Windows 8.1.

sync-external-folder-with-symbolic-link[4]

RELATED ARTICLES
Complete Guide to Symbolic Links (symlinks) on Windows or Linux
Want to easily access folders and files from different folders without maintaining duplicate copies? Here’s how you can use Symbolic Links to link anything in Windows 7, Vista, XP, and Ubuntu. [Read Article]
How to Sync Any Folder With SkyDrive on Windows 8.1
Before Windows 8.1, it was possible to sync any folder on your computer with SkyDrive using symbolic links. This method... [Read Article]

Windows

First, open a Command Prompt window as Administrator. On Windows 8.1 or 8, press Windows Key + X and click Command Prompt (Admin). On Windows 7, open the Start menu, perform a search for Command Prompt, right-click the Command Prompt shortcut, and select Run as Administrator.

open-command-prompt-as-administrator

Type the following commands into the Command Prompt window. In the first command, replace “C:\Path\To\ExternalFolder” with the path to the folder you want to sync and “C:\Users\NAME\Dropbox” with the path to your cloud storage folder. This command will move the entire folder to your cloud storage folder.

move “C:\Path\To\ExternalFolder” “C:\Users\NAME\OneDrive”

move-folder-to-cloud-storage-on-windows-8.1

Create a symbolic link at the original location. Programs that look for the folder at its original location will find it there. Any changes they make will be written to your cloud storage folder.

mklink /d “C:\Path\To\ExternalFolder” “C:\Users\NAME\OneDrive\ExternalFolder”

make-symbolic-link-for-onedrive-on-windows-8.1

Linux

On Linux, you should just be able to create a symbolic link with the ln -s command. You shouldn’t have to move any files around. Open a terminal and run the following command:

ln -s /path/to/ExternalFolder ~/Dropbox/

To synchronize an individual file, specify the path to that file instead of the path to a folder. If this method doesn’t work, first move the external folder to inside your cloud storage folder, and then create a symbolic link in reverse — like you would on Windows.

create-symbolic-link-for-dropbox-on-ubuntu-linux

Mac OS X

You can use the same command on Mac. First, open a terminal window — press Command + Space, type Terminal into the Spotlight search dialog, and press Enter. Run the following command, filling in the appropriate path:

ln -s “/path/to/ExternalFolder”  “/Users/name/Dropbox/ExternalFolder”

Google Drive won’t accept symbolic links created with the above command, but other services might. To make this work with Google Drive, move the folder you want to synchronize inside your cloud storage folder and then create the symbolic link in reverse:

mv “/path/to/ExternalFolder” “/Users/name/Google Drive/”

ln -s “/Users/name/Google Drive/ExternalFolder” “/path/to/ExternalFolder”

create-symlinks-for-google-drive-on-mac-os-x

Synchronize External Folders

You can use this trick to synchronize folders outside your cloud storage folder, too. For example, let’s say you have a C:\Stuff directory. You’ve moved it to your cloud storage folder, so you can access it under “Stuff” in your Dropbox folder and on the web. If you have Dropbox set up on multiple PCs, you’ll find your Stuff folder in the Dropbox folder. You can create the same symbolic links on each computer and the contents of your C:\Stuff folder will appear the same on all your PCs.


Some third-party programs will assist you in creating symbolic links for these services, but you can do it all with the tools included in your operating system. We don’t like recommending such third-party utilities when we can help it.

Some programs do allow you to synchronize any folder to the cloud, of course. SpiderOak — also nice because it’s fully encrypted so they can’t even see what you’re storing there — allows you to choose any folder on your PC to sync without messing with symbolic links, for example.

Chris Hoffman is a technology writer and all-around computer geek. He's as at home using the Linux terminal as he is digging into the Windows registry. Connect with him on Google+.

  • Published 08/11/14