Add Automatic Cloud Syncing To Any Mac App [How-To]

Add Automatic Cloud Syncing To Any Mac App [How-To]

Syncing any file or directory to Dropbox is easy using Terminal.

One of the greatest things about a service like Dropbox is that as long as you are either using apps with support baked in or can save your files to a Dropbox folder, you can keep all your data synced between multiple Macs.

What if you want to keep app data synced between Macs that don’t lend themselves to being saved to a Dropbox folder or don’t come with Dropbox support, though?

For example, most Mac games don’t allow you to specify where you keep your saves, but what if you want to be able to save your game on your iMac and then load it up again on the road on your MacBook Pro? Or what if you want to keep your app settings synced between your iMac and MacBook Air? Settings files are usually stored in a hidden system folder on your Mac, so how do you keep things synced then?

It’s actually way easier than you might think. Here’s how to keep any file or folder synced between Macs using the cloud, no matter where it’s stored.

The technique we’re using in this tutorial involves symbolic links. Symbolic links are old as the hills: they’ve been around since the 70s, and OS X has always had them, ever since the first release.

What symbolic links allow you to do is tell your Mac that a file or folder in one directory should be treated as if it were in another directory. For example, using symbolic links, you can tell your Mac that any time you write a file onto the Desktop, it should really be saved to your Documents folder instead.

What we will do in this tutorial is “trick” your main Mac into writing all of its changes to a given file or directory to your Dropbox folder instead. Then we will similarly “trick” your other Mac into accessing the synced data from your Dropbox folder instead of from its normal location.

Warning: Only try to sync files or folders that you will be using on one machine at a time! Doing otherwise could wreak havok. Also, this trick works best on smaller files and folders of less than a megabyte.

1. If you don’t already have one, register for a free Dropbox account, then download and install the free app on any Mac you want to keep in sync. A new folder called Dropbox will be created under your Users / [Your User Name] / directory. Any files or folders saved here will automatically be synced between any other Mac with Dropbox installed.

2. Find the file or folder you want to keep synced in Finder. Depending on the app you’re trying to keep synced, this could be tricky, but Google will usually tell you where your favorite app’s settings or save files are stored.

3. On one Mac, open Applications > Utilities > Terminal.

4. At the prompt in your main Terminal window, type “ln -s” without the quotes, then hit space. Don’t hit Enter!

5. Now drag the file or folder you identified in step two to your Terminal window. A path to that file or folder should automatically be appended to the end of the prompt. Again, don’t hit Enter!

6. Now find your Dropbox folder in Finder and similarly drag that folder on top of your Terminal window. Again, a path to your Dropbox directory should get appended to the end of the string.

7. You should have something that looks like this: ln -s /path/to/desired-file-or-folder ~/Dropbox/desired-file-or-folder. It’s okay, you can hit Enter now.

8. It won’t look like anything has happened, but if you go look in your Dropbox folder, you’ll now see a copy of the file or folder you want synced. Better yet, if you change the file or folder in its original location, the one in your Dropbox folder will also change. Why? Because it’s really the same file!

9. So far, so good. We’ve synced a file or folder in one location on your Mac to your Dropbox folder automatically. Now we need to tell all your other Macs to start looking for this same data in your Dropbox folder for now on.

10. On any other Mac you want to keep synced, find the same file or folder you identified in step 2 in a Finder window.

11. Back this data up somewhere else on your Mac in case something goes wrong, then — and this is scary! — Delete them from their original location.

12. Here’s where it gets cool. Open a new Finder window and go to your Dropbox folder. You should see the data you synced on your other Mac in step 8 already there.

13. Open Applications > Utilities > Terminal.

14. Type in “ln -s” at the prompt with a space at the end. Don’t hit Enter.

15. Drag the file or directory from your Dropbox folder onto the Terminal window. Again, don’t hit Enter.

16. Now drag the parent directory of the data you deleted in step 11 to the Terminal window.

17. You should now have something like: ln -s ~/Dropbox/desired-file-or-folder /path/to/parent-folder. Enter.

18. Repeat steps 10 – 17 for any additional Macs you want to keep in sync. Voila! You’ve now synced your data between Macs!

What did we accomplish here? Using the above steps, I added Dropbox support to the Mac rogue-like Dungeon Crawl: Stone Soup which automatically saves the game between turns: I can now start a game on my iMac and then continue it on my MacBook Air, all without ever playing a section of the game over. However, you could use this same technique to make sure that all your PhotoShop settings are the same between Macs, no matter which machine you change them on, or to create directories that sync with Dropbox even if they are located outside of your Mac’s Dropbox folder. Using this technique, as long as you know where your Mac app saves its data, you can automatically keep the data synced to the cloud. It’s all up to you!

Hope this was helpful. Let us know how you got on in the comments!

Related
  • Blake Beavers

    Gonna do this with Minecraft!

  • ZX6Rnet

    Isn’t it possible to do this by default with just a few clicks in SugarSync? Not to mention getting more free space

  • Jesse Hayges

    This was an AWESOME post! It will help me keep my games in sync between my MBA and my iMac at home. Thanks for this, John!

  • myglasseye

    You can do this a LOT easier by getting a utility that allows for the creation of symlinks right there in the Finder using the right-click menu. Exact same process of finding the original, creating a symlink, dropping it into Dropbox, removing the original etc, but you never have to launch Terminal.

    I forgot the name of the utility, you could google it though.

  • pbdoetmee

    Hi there, interesting post. Would this also work for Wuala? This service uses local encryption before sending to the cloud. Would this stand in the way?

  • pbdoetmee

    Hi there. Just found the answer to my question on Wuala support on this trick. Wuala does not support symlinking, so this trick won’t work for Wuala customers like me. The info can be found here: http://www.wuala.com/en/support/faq/c/19#id001936 (at the bottom of the page).

  • rayjay

    A great way to simplify this is with MacDropAny <zibity.com/macdropany>; maybe that’s what myglasseye was thinking of. It makes it very easy to to keep a Dropbox copy of folders from anywhere on your Mac. Then, by using the very helpful little guide provided by Stephen Foskett < http://blog.fosketts.net/2011/03/03/multiple-macs-sync-dropbox/ > you can quickly set up a second link from another Mac and keep both folders in permanent sync. This process preserves the original files on the separate computers and connects them via a symlink in Dropbox. 

About the author

John BrownleeJohn Brownlee is a Contributing Editor. He has also written for Wired, Playboy, Boing Boing, Popular Mechanics, VentureBeat, and Gizmodo. He lives in Boston with his girlfriend and two parakeets. You can follow him here on Twitter.

(sorry, you need Javascript to see this e-mail address)| Read more posts by .

Posted in How-To | Tagged: , , , , , , |