iCloud Terminal

Have you ever found iCloud re-downloading the same files, over and over again, despite having them removed only seconds before?

I have, so many times that I finally got fed up with the whole thing and spent days searching for a proper solution to this issue; which eventually led me to this Reddit page.

Here are the steps to knock some sense back into your iCloud.

If you already have iCloud enabled, you can skip to step 2.

Step 1: Enable iCloud

  • Open System Settings
  • Switch to the Apple Account tab.
  • Select iCloud
iCloud Settings
iCloud Drive Highlighted
  • Open the Drive panel.
  • Enable Sync this Mac
  • Enable Optimize Mac Storage

Step 2: Wait for iCloud to synchronize

  • In Finder, when synchronized, iCloud Drive will have a checkmark appear next to it, when you hover the cursor over it.
The icon that appears, when you hover over it, is clickable.
Clicking will bring up an info popover containing the status of iCloud.
iCloud Status

Step 3: Keep iCloud from re-downloading the same files

  • Open Terminal
  • Switch to the iCloud directory—listed in the command below.
Replace USERNAME with your own...
cd /Users/USERNAME/Library/Mobile\ Documents/com\~apple\~CloudDocs
  • If you have a specific file that’s causing the issue, then change to the directory containing it.
  • The following command will recursively mark every file, and directory, contained in the current directory for iCloud to safely remove.
WARNING: If this command is executed from the root iCloud directory, you will effectively purge every iCloud file from local storage.
find . -type f -exec brctl evict {} \;

Congratulations!!!
Those pesky files should now stay off your local drive until you actually need them!

Conclusion

Armed with the knowledge in this article, you should be able to keep iCloud from re-downloading the same files, especially after you’ve manually had them removed.

If you regularly use the Terminal on macOS, then you may find this article to be useful.

I hope this article provided you with what you were looking for. If you have any feedback, please leave a comment.

Credits

  • Apple – Parts of the Featured Image.