Creating a junction to sync files from anywhere on your PC with Dropbox

Just a little background info, I have been doing more and more work locally using XAMPP. Because the files are being worked on locally until they are worthy of being put into a live site there is a lot of room for murphy to make my day worse. Every once and a while I would backup my files onto my external drive just in case something happened to my computer. This while better than nothing, was not the best solution.

Dropbox

For anyone that doesn't know what<a hef="http://www.dropbox.com" target="_blank">Dropbox</a> is - it a fantastic service that allows you to sync files between multiple devices. Dropbox creates one directory usually called "My Dropbox" that syncs anything inside of it to the cloud.

Thoughts on using Dropbox

My initial thought was to just copy and paste the files to My Dropbox. Backing the files up daily would definitely be an improvement over my first method of using my external to backup once a week. I always try and figure out pros and cons to anything I do, it helps me to prepare for the worst. The biggest con I had was that if I backed up daily, what happens if I worked for 23.5 hours one day and just as I am backing my files up the computer crashes?

Past experience with SymLink

I had done some work with Ruby/Rails on my web host a couple years ago that required me to setup a SymLink from the root of the server to a directory accessible on the web. I wondered if it would be possible to create a SymLink between the directories on my computer so that it would continually sync the files I am working on in real time.

Junction to sync the files

After one quick Google search I came across Junction, a Windows utility that creates a link between directories.

Quick tip: If you place junction.exe in C:\WINDOWS you can execute the junction command from anywhere in the command prompt.

Steps to create junction

  1. Move the folder you want to sync with Dropbox into "My Dropbox".

  2. Jot down the path to "My DropBox" (c:\Documents and Settings\User\My Documents\My Dropbox) and "htdocs" (c:\xampp\htdocs).

  3. Open the command prompt (Start => Run OR hold down the windows key and press "R" and enter CMD into the prompt and press enter).

  4. junction "c:\xampp\htdocs" "c:\Documents and Settings\User\My Documents\My Dropbox\htdocs"

  5. It should prompt you with the directory created and the directory it targeted.

For more information on syncing with Dropbox visit their wiki.

If you have any feedback for me, I'd love to hear it - corrections, alternative paths, you name it! Send me an email levi@levijackson.xyz