I don’t usually recommend users to put their Desktop & Documents in iCloud, particularly on a desktop Mac, but there are times when it’s really useful. I have a MacBook Pro with limited internal storage, and often switch it between Mojave and Catalina beta. Putting its Desktop & Documents folders into iCloud Drive makes good sense, as I can then share contents effortlessly with my iMac Pro, and between different versions of macOS.
One of the snags in doing this is that (almost) everything in your Documents folder will then be synced with iCloud Drive. I’ve created a folder named OtherDocuments within my Home folder which I use for documents that I don’t want synced with iCloud, but that isn’t as convenient as having no-sync folders in ~/Documents itself.
One solution which used to work was to create a folder in ~/Documents, and inside it place an empty file named .nosync. You have to do that in Terminal, as that’s a hidden file which Finder won’t create for you. And when you’ve created it, you’ll probably discover that, in Mojave at least, this trick no longer works anyway.
The best solution is to create a folder whose name has the extension .nosync or .tmp, and keep all the documents that you don’t want synced inside that. macOS won’t sync anything which is inside folders with names like accounts.nosync or accounts.tmp. There are other possibilities too, although those are the most generally useful.
Items with the extension .nosync or .tmp are two examples of those which iCloud won’t sync. Among others are the following.
File and folders which are intended for local housekeeping and similar purposes:
- .DS_Store files
- files whose name starts (A Document Being Saved
- .ubd files
- names containing .weakpkg
- .tmp files
- desktop.ini files
- names starting with ~$
- named $RECYCLE.BIN, which are trash folders
- named icon\r
Files and folders which have purposes that make iCloud syncing inappropriate:
- named iPhoto Library, and presumably now Photos Library too
- named Dropbox, .dropbox, or .dropbox.attr
- with the extension .photoslibrary, .photolibrary, .aplibrary, .migratedaplibrary, .migratedphotolibrary, or .migratedaperturelibrary
- named Microsoft User Data
- with extensions .nosync or .tmp
- named ~ with an extension of 3 or more characters
My utilities Bailiff and Cirrus have a command to evict files, which is quite different. Items placed inside accounts.nosync are shown with the iCloud icon crossed out, indicating that no copy of them exists in iCloud Drive, and the folder directory isn’t even stored there either. Evicting an item to iCloud instead tells macOS to store that item and any contents remotely, and only to keep a local stub marker for it. That’s great when you want to recover the local space occupied by a file or folder which isn’t in use, but it actually does the reverse of putting those iems in a no-sync folder, which forces them to be stored locally and not in iCloud at all.
Finally, the Desktop & Documents option has an odd behaviour when you turn it off. In other situations, items which are shared in iCloud would then be downloaded to local copies. Turning off Desktop & Documents does the exact opposite: it removes all local files from those folders except for any marked as being no-sync. The contents of those folders are then made available in those folders in iCloud. If you want them to populate your newly localised folders, you’ll have to copy them all back down again.
Thanks to malhal who compiled this list by reversing the iCloud daemon.