11

I have a file on my desktop that is now synced with iCloud using the new feature of macOS.

I would like to delete it, but keep a copy of it in the iCloud.

I am nervous that if I simply delete it from my Mac, it will also be deleted in iCloud.

Is there a way to keep the iCloud copy, but delete the local copy?

For example, here are two directories on my desktop, one is only in the cloud, the other is both in the cloud and saved locally:

enter image description here

I would like to make the Personal Docs folder become like the Datasets folder

  • 1
    Move the file to iCloud drive. There’s no selective syncing of ~/Desktop and ~/Documents AFAIK – njboot Oct 7 '16 at 23:33
6

As Andreas mentioned in his answer, brctl evict purges the files. But for me, it seems to work permanently. Even purges recursively through folders. Maybe it is because I purged 40GB of data, hard for iCloud to reset in a heartbeat

>brctl evict SuperBigNestedFolder
evicted content of 'SuperBigNestedFolder/'

Nice!

BUT, when iCloud evicts the files it also throws away all metadata. This cripples Spotlight by removing the ability to search for text found inside popular file formats such as word, pdf, pages, keynote, or txt.

4

A nice finder extension does the trick~

https://github.com/Obbut/iCloud-Control

0

I have done some testing with this in macOS Sierra, but i hit a brick wall. There is the brctl command line tool. See man brctl. The option evict looked promising to me. So i tried it:

brctl evict test2.txt 
evicted content of 'test2.txt'

Well the problem is... this only works temporarily. At some point iCloud deamon (bird?) decides to re-download the files. One possibility would be to monitor brctl monitor -i and/or sudo brctl log -w and re-evict the stuff. I found no other way of stopping the re-download. Of course one could stop the deamon, but that's not really practical.

  • you can use Automator Folder Action to run the shell script – Maciek Rek May 6 '19 at 21:55

You must log in to answer this question.

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