10

Under iCloud in the Settings app, I have "Optimize Mac Storage" checked and "Desktop & Documents Folders" checked under "Apps that store documents and data in iCloud will appear here:"

enter image description here

This will cause some files in my "Documents" folder to be offloaded and replaced with a small file ending in ".icloud". I can download them by clicking on the cloud icon in the detail view in the Finder. I can also use "find" from the command line to show which files have been offloaded, eg "find . -name *.icloud | more".

Is there a command line way to cause these files to be downloaded, either by file or directory?

6

To my knowledge, there is no command included that allows you to directly download an iCloud file or folder.

But since I had exactly the same problem as you, I found that it was possible to do it in Swift with the startDownloadingUbiquitousItem function.

So I wrote a really simple Swift script for downloading both folder and file. You can download it on Github: iCloud Downloader

I hope I have answered your issue.

|improve this answer|||||
3

The command you are looking for is brctl (located in /usr/bin). man brctl will tell you all you need, but basically just brctl download /path/to/filename (without the .icloud extension) and evict will purge the locally cached copy.

|improve this answer|||||
  • Really nice! I much prefer using built in utilities! Oh...and Welcome to Ask Different! – Allan Feb 18 at 20:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .