The Burden of File Synchronization

The Burden of File Synchronization

First world problem alert! If you have the luxury of using two computers for your day-to-day coding – for example, a desktop for the office, and a laptop for home – you’ve likely found yourself complaining (or cursing) when your files aren’t syncing correctly.

Why can’t my laptop be an exact mirror of my desktop?

I know I have! I’ve even thought to myself, “Why can’t my laptop be an exact mirror of my desktop?” Well, there are ways to accomplish this, but, they’re time consuming and aren’t as consistent as you might hope. Nonetheless, let’s review a few ways that we can sync two computers.


Sync your Home Directory with Dropbox

It’s likely that all of us use Dropbox to some extent. The default installation will create a ~/Dropbox directory; however, we can also use “Selective Sync” to define which folders should be watched.

Selective Sync

Now, we could sync our entire home directory, as exemplified in the image above. There are still potential concerns with this method though:

1 – Space ain’t free, yo!

The basic free Dropbox plan offers 2GB of space – in other words, not very much. If you intend to sync your entire Home directory, you’ll need to commit to either the 50GB or 100GB plans, which will run you $120 or $240 a year, respectively. Yikes! Even worse, if you’re like me, you’ll find that even 100GB isn’t enough.

Dropbox Plans

2 – Endless Syncage

If you do choose to sync your entire home/ directory, you may find that, seemingly at all times, Dropbox is syncing. Download an iTunes movie on your laptop, and, when you turn your desktop computer on, it’ll take an hour to download that one large file. This can be incredibly irritating. Also, while, as I understand things, the process of downloading a large file shouldn’t interfere with small documents being synced at the same time, I’ve found that it often does. If I save a Word document on my laptop, sometimes it can be a good wait before it shows up on my other computer.

All of these small irritations quickly add up.

3 – CPU Intensive?

I must admit that this one is a bit odd. I’ve noticed that, at some points, Dropbox can be a bit hard on my CPU. After checking my computer’s Activity Monitor, I’ve found Dropbox taking up as much as 30% of my CPU, dramatically reducing my computer’s performance.

All that said, this seems to be a sporadic effect. As I write this article, while syncing, Dropbox is using less than 1% of my CPU. It’s certainly odd. Maybe you guys have some notes in the comments?


Use Synchronization with GoodSync

GoodSync

If you require a cheaper way to sync your files, you might look into GoodSync, which allows you to create any number of jobs (free edition is limited to three). For example, I could create a job which, each day, copies all of the files from a particular directory on my desktop over to my laptop. Alternatively, I could also instruct GoodSync to actively watch my Desktop directory and copy files over in real-time. If you choose this route, note that it can affect your computer’s performance a bit.

The obvious advantage to using GoodSync is that you’re not paying a monthly fee.

The service even makes the process of locating the various computers in your local network as easy as possible. If you sign into GoodSync on each computer, your file system will automatically be available across all computers.

Up until now, this is the method that I had been using. It certainly works, but, again, there are sporadic hiccups. Most notably, I still have to wait for the necessary files to copy over, and, again, from time to time, the app seems to falter and miss certain triggers.


It’s Difficult to Sync Settings

While some apps allow us to sync configuration settings and databases, via Dropbox, others do not. For instance, let’s consider an app that allows you to save commonly used snippets (Snippets in my case). You’ve likely found frustration in the fact that a snippet you save to your laptop’s version of Snippets will not be available on your desktop.

Snippets specifically allows you to sync your XML database via MobileMe, but most of us don’t use it – so, back to the drawing board.

The Common Solution

On the Mac specifically, the frequently advertised solution is to create a symlink.

So let’s do one together; our job is to sync the database for Snippets across our two computers with Dropbox. This database XML file will be stored within ~/Library/Application\ Support/Snippets.

First, cd/ to the Application Support directory, mentioned above.

 cd ~/Library/Application\ Support

Next, we’ll copy the Snippets directory over to Dropbox. If you’re not syncing your entire home directory, keep things clean and create an Application Support directory in the root of your Dropbox folder.

 mv Snippets ~/Dropbox/Application\ Support

Now, we’ll create a symlink. Make sure you’re still within the ~/Library/Application\ Support/Snippets directory, and type:

 ln -s ~/Dropbox/Application\ Support/Snippets Snippets

To better understand this line, think of it as: ln -s [path/to/directory/to/sync] [path/to/new/folder].. This code creates a symbolic link, which allows us to store Snippets’ database on Dropbox, but still function as expected. The app will want to find these files in the Application Support/ directory, and this method allows for that.

Repeat these steps for each computer, and then test it! Create a new snippet on your laptop, and watch it show up on your desktop, after Dropbox syncs the file.

So sure, this method works; but it’s not perfect.

  1. It’s time consuming. Will you do this for each app, or symlink your entire Application Support directory?
  2. Not all apps can be synchronized this way. For example, Quicken will kick up a fuss if you use this technique. I’ve yet to find a way to get Quicken to play nicely across multiple computers. There are countless forum threads on this particular topic. It’s easier to use Mint.com, if it’s available where you live.

Why Complicate Things?

One day, not more than a week ago, as I found myself, again, wishing that my laptop was a mirror for my desktop, I realized that I was complicating things. Why do I need two separate harddrives? How much time have I wasted researching synchronization tools?

From today on, I am now a “one computer” man. I’ve sold my iMac and laptop, and have replaced them with a 15 inch Macbook Pro and a Thunderbolt display. When I’m in my office, I connect the laptop to my monitor, work in the glorious 27 inch fashion that I’ve grown accustomed to. And when, I’m on the couch, or – gasp… in bed working – the laptop is disconnected, and it’s business as usual.

No more synchronization, no more complaining, no more hassles. It took me years to choose the most obvious solution.

My Question for You Is…

If you are in a similar position, how do you personally deal with the burden of file synchronizing?

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.photographerperkahwinan.com/ shah erhan

    I used dropbox to sync my php project (I set a virtual host apache setting pointing to a folder in dropbox then put my project directly into it). And I also used zumodrive.

  • http://vivekv.com Vivek

    You can also use SVN for this kind of tasks. I use it. And I am able to sync contents and access it from my office and home pc. Its great and does not use much CPU

  • http://www.giorgioprovenzale.it Jerry

    In my opinion the best solution to synchronize folder via PC / Mac / iPhone/ Android is SugarSync. You have 5 GB of free space and if you invite other friends get 500mb free. The syncronization works perfectly and you have many options to set it.

    This is the link with my invitation:
    https://www.sugarsync.com/referral?rf=dydcmj3kac7p8&utm_source=txemail&utm_medium=email&utm_campaign=referral

  • http://www.bogdanrosu.com Bogdan

    I use goodsync, it even syncs my mail and stuff. very usefull.

  • Ben

    I have the same problem and still no good solution. I have different devices (Android tablet, OS X Macbook, Windows 7 Laptop) and want some directories being synced between all three devices. I only want to sync them over Wi-Fi, not over Internet (it’s slow and I dont want to use “clouds”)

  • Scott

    I use a git repo for backing up and syncing music and documents

  • http://Mastomillers.com Jed

    Having two computers is handy not just for work/home, but for being able to continue working when one bombs or is running CPU-intensive tasks, etc. In the heat of a looming deadline, having everything critical already synced is a blessing. I’ve mixed and matched to take advantage of free space from various services – Dropbox for critical documents and symlinked prefs, SugarSync for web dirs/code, and Wuala for photos and other personal stuff. Sounds like a hassle, but there’s also a great advantage to getting to know the different programs so intimately, especially if your job benefits from IT skills. (Two computers is great for this too – TextMate on one, Sublime Text 2 on the other. Cyberduck on one, Transmit on the other, etc.)

  • Rodrigo

    I use SparkleShare http://sparkleshare.org/ , it’s a good opensource alternative of Dropbox!! I installed it in my own server in Dreamhost ( this use GIT for the sync and a desktop app like dropbox)

  • http://www.christopherjones.com.au CJ

    I also use SugarSync. It solved my home/office/mobile synchronization issue and everything is always backed-up.

    Admittedly, I am a web developer and mainly work with small files. But I also have all my photos and music library synced/backed-up as well.

    I first read about in a comment on this site about a year ago. Since then I’ve had total peace of mind. Best $4/mth I ever spent!

    Hope this helps someone else too.

    CJ

  • http://andy-russell.com Andy

    I sync all my dev projects to bitbucket. This way I can make sure I get the most recent copy from wherever I am. I then use a combination of Dropbox & Mobile Me to copy other bits like snippets, FTP accounts (Transmit), keychains, email accounts, calendars, contacts, etc..

    Unfortunately, I have to use the PC at work, and I have a desktop Mac Pro and a Mac Book Pro at home, also an iPhone, and iPad. So trying to sync all 5 is slightly more annoying.
    But this way works pretty well so far! :)
    Just need to get rid of the PC to make it all smooooooth sailing!

  • http://www.acrocash.com jack

    i better go for external drive backup for data security…;-)

  • ertpresso

    Before I had to switch to Windows from Linux because of tiresome compatibility issues between Word and Openoffice Writer, I used to use a USB stick as my primary storage, holding all my my folders and settings encrypted and synced very quickly and automatically by Unison whenever I put the drive in. It was secure and fast and always accessible.

    Now, I have three Windows machines and an iPhone. Apparently having ignored my worries about privacy, I swiched to “clouds”.

  • http://www.youtube.com/user/izvarzone Some Guy

    That’s the reason I prefer to manually move files to Dropbox folder, so it doesn’t start uploading files I’d not want on other PC automatically, eating bandwith and CPU.