Ubuntu announced the pending shutdown of their Ubuntu One services recently. I depend on Ubuntu One to sync my ~/Documents folder between my desktop and laptop, and have even bragged to Windows users how easy it is to get files from one computer to the next using Ubuntu One. It seems that Canonical does not make enough money through their services, would rather focus on other projects, and so are shutting it down completely on June 1st. This led me to finding an alternative solution.
Google Drive allows one to upload up to 15 GB of data to the cloud for free (100 GB is only $2/month). There are many services out there that do the same sort of thing, such as Dropbox or Amazon Cloud Drive, and a quick search will reveal other cloud storage solutions. The major downfall to using something other than Google Drive is that the common amount of free space given for storage is somewhere between 2 to 5 GB, with steep prices if you wish to expand. I am an avid Android user, so I already make use of my pictures getting automatically pushed to Drive, as well as awesome Gmail integration. So for me, the decision was simple: find a way to sync my two computers using Drive.
Introducing InSync. At the most basic level, it allows a user to automatically sync data between a specified folder on their computer (/home/user/Insync, or whatever you desire to name it) and Drive. This is useful, but other services offer the same thing (Grive, SyncDrive, etc). But where InSync prevails is all the other stuff it is capable of:
- Automatic conversion of Google Docs to Office (LibreOffice/OpenOffice compatible)
- Built-in sharing without a browser
- Recent changes feed
- Window manager integration (ie Nautilus) - right-click a file to sync
- Symlink, junction and alias support (key feature; more on this below)
- Multiple Google account support
- Watch any folder for changes
- Support for almost every platform
- And many others
As you can see by their features, InSync has done a great job at integrating Google Drive into the desktop environment. Back to my original issue, however, is that I needed to sync two computers to be mirror images of each other. This process is not glaringly simple in InSync, so this is how you do it:
- Ensure all your files are synced between the two machines using Ubuntu One or other methods
- Download InSync on one of the computers (we'll say desktop, for ease of explanation).
- Complete the installation, choosing the "Advanced Setup" when prompted
- Authenticate InSync with your Google account and choose where to store your files (/home/user/Insync).
- Once InSync has finished installing, Nautilus users (Ubuntu) may want to install package insync-nautilus in order to have right-click menu integration.
- sudo apt-get install insync-nautilus
- Restart Nautilus by clicking the prompt once that completes, or by logging out and back in.
- Another method is by opening terminal (Alt F2) and typing nautilus -q. This will kill the window manager. You start it back by opening a folder either from Ubuntu's side bar, or pressing the Super key and typing home, and opening the folder.
- Now the fun part: create a symlink inside your InSync folder to your Documents folder:
- Right-click Documents in your home folder > Add to Insync > Your Google Account
- OR: ln -s ~/Documents ~/Insync/Documents
- This will sync all of your Documents to Google Drive. Give it some time to finish. Once the InSync icon in the toolbar looks like: you are ready to proceed.
- On your other computer (laptop), prepare it for syncing by installing InSync, and choosing Advanced Setup again. Do not put anything in the InSync folder, as your desktop and laptop are currently mirror images of each other via Ubuntu One.
- Don't forget to install the Nautilus integration and restart Nautilus (step 5)
- Go to InSync > Your Google Account Name > Settings > "Selectively sync your files & folders"
- Choose the Documents folder from your Google Drive, and Apply Changes
- Allow all of your Drive's documents to sync to your laptop
- On the laptop, rename ~/Documents to ~/Docs
- mv ~/Documents ~/Docs
- In the terminal on your laptop:
- ln -s ~/Insync/Documents ~/Documents
- This creates a symlink from Insync's Documents directory to a non-existing ~/Documents on your Laptop. (note** non-existing because you have renamed the ~/Documents folder on step 9)
- Note that this symlink is opposite of step 6.2, because we want to create the illusion of a ~/Documents folder that is actually under ~/Insync/Documents, allowing all previous shortcuts to continue working.
That's it! Your files on your laptop and desktop will stay in sync with each other.
Now go disconnect Ubuntu One!