On-Boarding if Using iCloud w Optimization

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

On-Boarding if Using iCloud w Optimization Tue Mar 07, 2023 8:36 am • by sccardais
What is the best way to process existing files if they are currently stored in iCloud with "Optimization" enabled?

As I understand it, Hazel rules won't match files unless they are stored locally which excludes most of my files.

I know that double-clicking a file will move it from iCloud and allow Hazel rules to match but it's impractical to do this for thousands of files.

If I turn off "Optimization", will that automatically enable Hazel to "see" these files and process my Hazel rules?

Are there better ways to deal with this problem? If you have any experience with this issue, have you resolved it successfully and how?

Thanks for any help.
sccardais
 
Posts: 12
Joined: Mon Jul 30, 2012 6:42 am

Best way would be to turn off optimization so that everything is available locally.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Best way would be to turn off optimization so that everything is available locally.
.

The trouble with this solution is that Apple charges an arm and a leg for adding storage on a new Mac, and you can't upgrade the storage later. For me, even having bought a 512 GB M1 MacBook Air, I can't fit all my iCloud documents into the storage available so I am forced to use optimization. To explain, I originally created a lot of files in the Documents folder on an iMac 27
inch with a 3 TB hard drive.

The original post says that Hazel will not match files which are not stored locally so that may be a way around the problem. With optimisation switched on you have no control over which files will be moved from the local storage into iCloud Drive but files you are working on locally will stay there at least long enough to allow Hazel to sync them. In my case, that would be to my NAS, to which I would copy folders individually (you can right click on folders to download them locally and subsequently to remove the download, leaving the files still in iCloud).

What I don't know is how to make sure that Hazel doesn't delete files and folders in the backup location which Apple chooses to take out of local storage. I'd appreciate advice on how to avoid that.
Ian Downie
 
Posts: 2
Joined: Fri Dec 16, 2022 12:50 pm

I'm not sure how you have your rules set up so I can't say. Why do you think Hazel will delete files?
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:I'm not sure how you have your rules set up so I can't say. Why do you think Hazel will delete files?


I haven't set up any rules yet. Why am I worried that Hazel will delete files? I don't know how it will treat a file which is in the backup location when Apple chooses to replace the local version of the iCloud Drive file. Issuing the terminal command ls -al on a file which is physically located in ~/Library/Mobile Documents/Documents shows the file properties as normal for a locally stored file. If you do the same thing for a file which is not downloaded from iCloud (shows a cloud symbol with a down arrow), the result is 'No such file or directory'.

I've realised that I am thinking more of a sync operation (two way) rather than a one way process to copy the file to the backup location, which is what I have my existing Hazel rules set up to do. It certainly seems to work OK even with optimisation switched on, as the files stay local at least long enough for Hazel to move them to their specified locations, which currently are all on my MacBook Air SSD. I've now managed to download locally the contents of a very large folder and am in the process of copying it to my NAS. I'm taking the opportunity to tidy up the folder and, once I've finished that, will try modifying a rule to copy the file to the appropriate place in the NAS as well as moving it to its home on the SSD.

Here's another question: all my rules involve files which originally go into a folder which is outside of my Documents folder before they are moved into the appropriate sub folder in Documents. Can I set up a rule which looks for any addition to the Documents folder, even down multiple levels, and copies the file/folder to the same location on the NAS? I can see an option to Copy folder structure/from monitored folder - will that do the trick? If that worked, it would not only allow me to keep a copy of everything in iCloud Documents on the NAS, it would save my having to edit 46 separate rules.
Ian Downie
 
Posts: 2
Joined: Fri Dec 16, 2022 12:50 pm

Look up "subfolders" in the manual. There's a whole chapter on having Hazel go into subfolders.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support