Sync Mac Desktops

June 09, 2016 - posted by Josh Smith

Sync Mac Desktops

Modern web worker’s workflow needs to be as efficient as possible. Part of that workflow demands that we work on multiple computers. I, for one, love to work on my iMac. I have space, both at my desk and at on my computer’s Desktop screen. When I have to leave to speak with someone or to go to a class I take my MacBook Pro. It is a very capable machine but that is all I take with me. I don’t have any peripherals like mice, keyboard, or external drives or monitors. Basically, I need an Internet connection to take notes and look up references. If I could sync my Mac Desktops I could save a lot of time. 

What’s the problem

Dropbox and Google Drive are my favorite syncing methods. These services let me share work with others. Google Drive, in particular, lets me collaborate with other people at the same time! When I’m on a team that is great.

I use my desktop as a temporary holding space for the work I’m currently involved in. It could be images that I want to upload to a website or research for a presentation. It doesn’t really matter.

Since I go back and forth between machines I needed to come up with a solution. Since the Desktop on our computers are just directories anyway why couldn’t I just link them together somehow?

Symlink all the stuff

I already use Dropbox and in that service I hold all my other syncs settings. Settings for text editors, email clients, and productivity tools are kept there. So that is what I did with my Desktops; I symlinked them to the same directory.

What is a symlink?

Basically it is a reference to another location in your operating system. When your operating goes looking for the Desktop it’ll be immediately directed to the location that resides in your Dropbox.

What happens if I can’t connect to my Dropbox account?

It won’t matter. Dropbox has placed a folder in your user directory to hold information. Your data actually lives in that location and then is synchronized up to the cloud, wherever that is.

How to do it

I’m assuming that you have a Dropbox account and that it is installed on your computer. I’m also assuming that you’re on a Mac. You also obviously have more than one machine. This process will involve some intermediary synchronizing so purge your Desktop of unnecessary items; i.e. clean it down to the metal. Move all your Desktop items to a temporary location for now.

Let’s get started.

On your first machine, open Terminal. If you don’t know it’s in Applications>Utilities.

From there you’ll need to move into your Dropbox folder. Use this command from Terminal

mv ~/Dropbox

You can identify what directory you’re in if you type: pwd

Now create the link:

ln -s ~/Desktop

Pro tip: For the really deep file paths, save yourself some headache and drag and drop from Finder onto Terminal.

Next, let any file syncing happen. It shouldn’t be much. Mounted volumes won’t sync so don’t worry about that. Ideally, your desktop is clean, anyway.

Next turn off Dropbox on your first machine. Your local symlink will exist and your Dropbox version will also exist. Remember the Dropbox version will exist in the cloud and on your local machine. Now got to your other machine. You’ll have a Dropbox folder in there that you can check to see if there is directory named Desktop. I put all my symlinked directories at the root of my Dropbox folder. From your other computer you’ll see that new Desktop directory.

Now, quit Dropbox on your second machine. Next, move into your second machine’s Dropbox folder and delete the Desktop directory. Don’t worry. If you delete a symlink it does nothing to the original files. Now go into the second machine’s Terminal and repeat the steps from above. You’re going to symlink your Desktop to that machine’s Dropbox. As in:

cd ~/Dropbox

Then

ln -s ~/Desktop

On your second machine turn Dropbox back on. Turn your Dropbox back on on your first machine. You can’t symlink to a file that already exists. It wouldn’t be symbolic, it’d be actual. You destroyed the first symlink and replaced it with an identical one. The first machine is none the wiser. It thinks it is and always has been pointing to the exact location since spelling and locations are exactly the same. Pretty sweet.  

 

© 2019 All Rights Reserved

Designed by Josh at Efficiency of Movement