Remember my post about how to use "mklink" to create hard folder links to "consolidate" disparate folders into a bundle that can be easily backed up to the cloud? Well, this week, I quickly learned this technique works for a LOT of other cloud storage providers' schemes.
I wanted to set up our Mac Mini running OSX Lion, so that Christy's and Gabe's "Documents" and "Pictures" folders would auto-back-up to the Cloud. I have decided on Microsoft's OneDrive as the target cloud storage solution. More on why later.
OSX supports folder hard-linking at the OS level, but does not expose this via command line NOR UI to keep users from hurting themselves with recursion.
I thought I could remove the OS-generated folders for Documents and Pictures, move their contents to the OneDrive equivalents, and create soft links from the OneDrive folder entries to where the OS-generated ones were. OSX is smart, though, and would not allow this.
So it seems I had to move Moses to the mountain. I tried the converse - let the OS-generated folders stay as-is, and provide soft links to the folders in the OneDrive container. This did not work - OneDrive was smart enough to know the targets were soft links and not bona fide folders.
Seems I needed hard-linked folders to make OSX and OneDrive think they were each dealing with native folder entities. But where would I get a utility that generates hard-links for folders? Here!
http://stackoverflow.com/questions/1432540/creating-directory-hard-links-in-macos-x The catch? I had to install Xcode and use a C compiler to compile a 15-line chunk of custom code into an OSX executable! Luckily this was not terribly hard for me at least.
Once the executable was created, I closed up OneDrive, opened an OSX terminal, cd'd to my user root folder, and executed the following:
$ hlink Documents OneDrive/Documents
$ hlink Pictures OneDrive/Pictures
At this point, the OneDrive folder had two "subfolders", which were in fact the content of the OSX folders of the same name. But once I restarted OneDrive, it thought that these subfolders were fully autonomous, and it started mirroring the content to the cloud.
The final check will be to see if OneDrive somehow responds to folder change activity on its folder instances when the OS-located folders bear witness to changes...