Apple - How to exclude a sub folder from iCloud drive in macOS Sierra?

Adding one empty file named .nosync to a folder will prevent that folder from syncing.

You can also use this as a file extension to specific files, but the folder treatment is quite useful.

Once you've had a folder sync, you can now also prevent it from syncing on some (or all endpoints) with a utility named Bailiff, if for some reason you don't want just to delete the files from iCloud entirely and instead want to prevent the next "initial" sync.

  • https://eclecticlight.co/downloads/

Here are all the file/folder names excluded so maybe one of these could be used for a workaround:

Filename:

  • is .DS_Store
  • begins with (A Document Being Saved
  • contains .nosync (in any case)
  • is .ubd
  • contains .weakpkg
  • is tmp (in any case)
  • is .tmp (in any case)
  • is desktop.ini (in any case)
  • begins with ~$
  • is Microsoft User Data (in any case)
  • is $RECYCLE.BIN (in any case)
  • is iPhoto Library (in any case)
  • is Dropbox (in any case)
  • is OneDrive (in any case)
  • is IDrive-Sync (in any case)
  • is .dropbox (in any case)
  • is .dropbox.attr (in any case)
  • is icon\r (in any case)

Extension is (in any case):

  • tmp
  • photoslibrary
  • photolibrary
  • aplibrary
  • migratedaplibrary
  • migratedphotolibrary
  • migratedaperturelibrary

Extension is more than 2 chars and filename is ~

Source: reversing iCloud daemon.

Hopefully in a future version of the OS they let us put .nosync inside the folder to exclude it, or have an .IgnoreList like Resilio has.


Rename the folder or file:

mv fileorfolder fileorfolder.nosync

Create a symlink that get's synced:

ln -s fileorfolder.nosync fileorfolder

Repeat on every machine.

Tags:

Macos

Icloud