Does iCloud sync to Mac when you're not logged in?

Hi folks!

I’d like to use an iMac as a “backup server” to sync iCloud data (full, not “optimized”) for various family members, thereby acting as a remote backup for them. Things like iCloud Photos, iCloud Drive, Contacts, etc. (I will also sync Dropbox to there, too, but that’s out of scope of this question…)

So, obviously I have to have accounts set up for them on the iMac and their Apple IDs and iCloud settings configured. The question is whether they need to be LOGGED IN for the sync to happen? The concern is that, after reboots, everyone is logged out, and I don’t want to find out months of data was not backed up because someone rebooted the iMac months ago without my knowledge.

A couple of people have asked, and not gotten adequate answers:

https://discussions.apple.com/thread/253086784

I could experiment; but there’s enough latency logging in and syncing, that I’d rather not trust trial and error. Curious if any of you have insight here.

Thanks!

Dave

2 Likes

Not to distract from your question (for which I’m also curious to hear the answer), but I’d also wonder if a user needs to be logged on as the current “GUI user” for lack of a better term, or if it’s good enough to use FUS to ensure that everybody initially longs on once (and they then don’t log out), and from then on all their iCloud stuff will always sync in the background, even if another user on that system in the meantime has become the foreground user.

Well, yes. Good question, and I was wondering that, too. Great minds lol. I’m expecting the answer to that will fall out of this discussion. Basically, if it can sync without even being logged in, it can certainly sync without being the active “GUI” user…

I took a different approach with a Mac Mini that’s the backup destination for all our other Macs. I use CCC to copy data to the Mini. All the Macs have adequate storage so cloud data isn’t optimized.

I’m currently traveling and using my MacBook Air. Anything that changes is synced to iCloud, then synced back to my iMac at home which was left on. It is then backed up to the Mini and the Mini is backed up to BackBlaze.

1 Like

Interesting setup.

Okay, so that works with your MBA. You mentioned “all our other Macs”. For me, that means Macs that are not in my home (kids at college). So CCC cannot access them (right?)

But the second (or maybe primary) difference with your set up is that for you, “All the Macs have adequate storage so cloud data isn’t optimized.” That simply not a workable solution for most of my family. With lots of media files, local MacBook storage is either prohibitively expensive or simply not large enough…

Yeah, the kids at college are a problem. I would try the fast user switching to see if it syncs when it’s not the currently active user. Should be easy enough to test with just two users. Set the users up and let them sync. Add a file to the non active users account, stop the internet connection, switch to that user and see if the new file synced.

1 Like

I don’t know about iCloud, but I know that Microsoft OneDrive volumes only sync when the OneDrive app is running - which is only when you’re logged in. And even then, it only syncs your files, not files belonging to any other users.

Now, iCloud is a part of macOS, so it may be doing things differently, but I wouldn’t assume so until someone can refer to an official statement or has actually tested it.

2 Likes

If you enable SSH (in the Sharing preference pane), you can test without logging in. Reboot the iMac. Then from another Mac, upload a largish file (100+ MB) to iCloud. Wait an hour leaving the iMac in its freshly rebooted, non-logged in state. Then ssh into the iMac from your other Mac, change to the iCloud directory on the command line, and see if your file is there. Even if logging in over ssh somehow triggers an iCloud sync, with 100+ MB, it shouldn’t have time to download in the <30s it takes to ssh in and list the iCloud directory.

3 Likes

For me, life is the process of hoping and praying someone else did the leg work and often finding out no one did so I have to do it myself LOL.

I may try this. Daughter just got home from college and hopefully has her (now unused) external drive so I can set it up for her local sync to this iMac.

But I’m not sure why I couldn’t just use glenthompson’s idea of just shutting off WiFi and then logging in to check…?

You absolutely could. My suggestion was in case you wanted to check whether iCloud syncing works straight after a reboot, before anyone has logged in. It also occurs to me that you could use ssh to disable WiFi and then log into the Mac as per normal to see if it’s synced. Apparently this command would do it (haven’t tried myself):

$ networksetup -setairportpower Wi-Fi off

(as per macos - Command Line (CLI) Command for disconnecting wifi from current network - Ask Different)

:grin: I know what you mean!

So each of your people have their own appleid/iCloud account correct? Then when they sync to iCloud, all their data is on the cloud. They would need to all be logged into their own accounts on your Mac and signed into their iCloud accounts on there for them to sync with the Mac in the first place, as you said. If you leave them all logged in all the time and just switch users back to yours, it may keep their iCloud up to date while the Mac is running. Try it and see? Oh also, have power nap enabled in everyone’s Energy Saver setting.

Based on my experiments today, the answers are:

Yes.

No.

A post was split to a new topic: iCloud Photos not available when the system library is on a network volume?

Finally circling back to this. Found a spare 3TB external drive in my “goodie cabinet” to use for this purpose, moved the Photo Library configured under my daughter’s login to this external drive, made sure it was enabled for iCloud (and Download Originals), and let it begin to sync.

Since it’s writing to an external drive and still trying to catch up with photos in the Cloud, it’s actually pretty easy to see when it’s actively syncing for stalled: I watch the file size of the photo library on the external drive which I can obviously see even from my own login.

And my results so far match @chirano it stays busy syncing even when she’s not the active “GUI” user, but only if she’s “logged in”. (Update: note that the Photo Library appears to update even when the Photos app is not running, just as for “active” users). So, after a reboot, logging in as me, all her syncing stopped. That stinks. That means this is not a convenient unattended backup solution. Any time I have a power outage or (more often) Mac crash or reboot due to an upgrade, my other family members I set up to backup this way will have to be logged back in, or their backups will get stale. And since I sometimes don’t even realize the Mac has been rebooted, it could go for a while before I notice, exposing them to data loss.

I still might do this, at least for now, in the absence of something better, and given that iCloud will probably not lose their data. But it’s not ideal.

2 Likes

Update:

I noticed this morning that, while logged in as me all night, her Photos appeared to still be syncing, which means it must have been proceeding very slowly overnight because I don’t think there was THAT much to sync.

So I spent a couple minutes trying to find some free app to plot disk usage over time, but nothing was immediately forthcoming (ideas?). So, I wrote a shell script. You pass in the name of the volume, and it stamps the disk usage in MB every 5m along with a timestamp.

iMac:~ dave$ cat disk_usage_log.sh

#!/bin/sh

LOG_FILE="./$1_usage.log"

while true
do
   /bin/echo -n `date` >> $LOG_FILE
   /bin/echo -n " - "  >> $LOG_FILE
   df -ml | grep "$1" | cut -wf3 >> $LOG_FILE
   sleep 300
done

Sure enough the sync rate is highly non-linear. See the annotations I put in the log below:

iMac:~ dave$ cat Family\ Backups_usage.log 
Thu Feb 2 07:41:43 EST 2023 - 244210     # started running script
Thu Feb 2 07:46:43 EST 2023 - 247083
Thu Feb 2 07:51:43 EST 2023 - 248841
Thu Feb 2 07:56:43 EST 2023 - 250101
Thu Feb 2 08:01:43 EST 2023 - 250908
Thu Feb 2 08:06:43 EST 2023 - 251510
Thu Feb 2 08:11:43 EST 2023 - 252294
Thu Feb 2 08:16:43 EST 2023 - 253229
Thu Feb 2 08:21:43 EST 2023 - 253707
Thu Feb 2 08:26:43 EST 2023 - 254023     # left for work while switched to my user
Thu Feb 2 08:31:43 EST 2023 - 254501
Thu Feb 2 08:36:50 EST 2023 - 254496
Thu Feb 2 08:41:50 EST 2023 - 254502
Thu Feb 2 09:06:26 EST 2023 - 254492     # why did it go backwards here? Appears to fumble backwards and forwards all morning long...!
Thu Feb 2 09:11:26 EST 2023 - 254493
Thu Feb 2 09:16:26 EST 2023 - 254527
Thu Feb 2 09:21:26 EST 2023 - 254494
Thu Feb 2 09:26:26 EST 2023 - 254456
Thu Feb 2 09:31:26 EST 2023 - 254436
Thu Feb 2 09:36:26 EST 2023 - 254561
Thu Feb 2 09:41:26 EST 2023 - 254717
Thu Feb 2 09:46:26 EST 2023 - 254522
Thu Feb 2 09:51:26 EST 2023 - 254548
Thu Feb 2 09:56:26 EST 2023 - 254566
Thu Feb 2 10:01:26 EST 2023 - 254585
Thu Feb 2 10:06:26 EST 2023 - 254619
Thu Feb 2 10:11:26 EST 2023 - 254625
Thu Feb 2 10:16:26 EST 2023 - 254533
Thu Feb 2 10:21:26 EST 2023 - 254545
Thu Feb 2 10:26:26 EST 2023 - 254548
Thu Feb 2 10:31:26 EST 2023 - 254538
Thu Feb 2 10:36:26 EST 2023 - 254536
Thu Feb 2 10:41:26 EST 2023 - 254543
Thu Feb 2 10:46:26 EST 2023 - 254560
Thu Feb 2 10:51:26 EST 2023 - 254584
Thu Feb 2 10:56:26 EST 2023 - 254584
Thu Feb 2 11:01:26 EST 2023 - 254597
Thu Feb 2 11:06:26 EST 2023 - 254614
Thu Feb 2 11:11:26 EST 2023 - 254644
Thu Feb 2 11:16:26 EST 2023 - 254628
Thu Feb 2 11:21:26 EST 2023 - 254643
Thu Feb 2 11:26:26 EST 2023 - 254633
Thu Feb 2 11:31:26 EST 2023 - 254625
Thu Feb 2 11:36:26 EST 2023 - 254604
Thu Feb 2 11:41:27 EST 2023 - 254616
Thu Feb 2 11:46:27 EST 2023 - 254606
Thu Feb 2 11:51:27 EST 2023 - 254604
Thu Feb 2 11:56:27 EST 2023 - 254604
Thu Feb 2 12:01:27 EST 2023 - 254586     # came to a royal, grinding halt here! Siesta time??
Thu Feb 2 12:22:03 EST 2023 - 254586
Thu Feb 2 12:27:03 EST 2023 - 254586
Thu Feb 2 12:32:03 EST 2023 - 254586
Thu Feb 2 12:37:03 EST 2023 - 254586
Thu Feb 2 12:42:03 EST 2023 - 254586
Thu Feb 2 12:47:03 EST 2023 - 254586
Thu Feb 2 12:52:03 EST 2023 - 254586
Thu Feb 2 12:57:03 EST 2023 - 254586
Thu Feb 2 13:02:03 EST 2023 - 254587
Thu Feb 2 13:07:03 EST 2023 - 254587
Thu Feb 2 13:12:04 EST 2023 - 254587
Thu Feb 2 13:17:04 EST 2023 - 254587
Thu Feb 2 13:22:04 EST 2023 - 254587
Thu Feb 2 13:27:04 EST 2023 - 254587
Thu Feb 2 13:32:04 EST 2023 - 254587
Thu Feb 2 13:37:04 EST 2023 - 254587
Thu Feb 2 13:42:04 EST 2023 - 254587
Thu Feb 2 13:47:04 EST 2023 - 254587
Thu Feb 2 13:52:04 EST 2023 - 254587
Thu Feb 2 13:57:04 EST 2023 - 254587
Thu Feb 2 14:02:04 EST 2023 - 254587
Thu Feb 2 14:07:04 EST 2023 - 254587
Thu Feb 2 14:12:04 EST 2023 - 254587
Thu Feb 2 14:17:04 EST 2023 - 254587
Thu Feb 2 14:39:27 EST 2023 - 254588
Thu Feb 2 14:44:27 EST 2023 - 254600
Thu Feb 2 14:49:27 EST 2023 - 254626
Thu Feb 2 14:54:27 EST 2023 - 254649
Thu Feb 2 14:59:28 EST 2023 - 254648
Thu Feb 2 15:04:28 EST 2023 - 254684
Thu Feb 2 15:09:28 EST 2023 - 254685
Thu Feb 2 15:14:28 EST 2023 - 254664
Thu Feb 2 15:19:28 EST 2023 - 254676
Thu Feb 2 15:24:28 EST 2023 - 254695
Thu Feb 2 15:29:28 EST 2023 - 254724
Thu Feb 2 15:34:28 EST 2023 - 254744
Thu Feb 2 15:39:28 EST 2023 - 254742
Thu Feb 2 15:44:28 EST 2023 - 254769
Thu Feb 2 15:49:28 EST 2023 - 254778
Thu Feb 2 15:54:28 EST 2023 - 254823
Thu Feb 2 15:59:28 EST 2023 - 254858
Thu Feb 2 16:04:28 EST 2023 - 254911
Thu Feb 2 16:09:28 EST 2023 - 254908
Thu Feb 2 16:14:28 EST 2023 - 254905
Thu Feb 2 16:19:28 EST 2023 - 254907
Thu Feb 2 16:24:28 EST 2023 - 254915
Thu Feb 2 16:29:28 EST 2023 - 254938
Thu Feb 2 16:34:28 EST 2023 - 254947
Thu Feb 2 16:39:28 EST 2023 - 254935
Thu Feb 2 16:44:28 EST 2023 - 254938
Thu Feb 2 16:49:28 EST 2023 - 254944
Thu Feb 2 16:54:28 EST 2023 - 254944
Thu Feb 2 16:59:28 EST 2023 - 254942
Thu Feb 2 17:04:28 EST 2023 - 254956
Thu Feb 2 17:09:28 EST 2023 - 254955
Thu Feb 2 17:14:29 EST 2023 - 254942
Thu Feb 2 17:19:29 EST 2023 - 254950
Thu Feb 2 17:24:28 EST 2023 - 254952
Thu Feb 2 17:29:28 EST 2023 - 257209     # I came home from work, switched to her login, and opened Photos. Sync woke up with a vengeance!
Thu Feb 2 17:34:28 EST 2023 - 260356
Thu Feb 2 17:39:29 EST 2023 - 265139
Thu Feb 2 17:44:29 EST 2023 - 268112
Thu Feb 2 17:49:29 EST 2023 - 268689
Thu Feb 2 17:54:29 EST 2023 - 270560
Thu Feb 2 17:59:29 EST 2023 - 273244
Thu Feb 2 18:04:29 EST 2023 - 275453
Thu Feb 2 18:09:29 EST 2023 - 277725
Thu Feb 2 18:14:29 EST 2023 - 279106
Thu Feb 2 18:25:17 EST 2023 - 279149
Thu Feb 2 18:30:18 EST 2023 - 279149
Thu Feb 2 18:49:19 EST 2023 - 281551
Thu Feb 2 18:54:19 EST 2023 - 282472
Thu Feb 2 18:59:19 EST 2023 - 282642
Thu Feb 2 19:04:19 EST 2023 - 282898
Thu Feb 2 19:09:19 EST 2023 - 283310
Thu Feb 2 19:14:19 EST 2023 - 283317
Thu Feb 2 19:19:19 EST 2023 - 283327
Thu Feb 2 19:24:19 EST 2023 - 283305
Thu Feb 2 19:29:19 EST 2023 - 283309
Thu Feb 2 19:34:19 EST 2023 - 283313
Thu Feb 2 19:39:19 EST 2023 - 283311
Thu Feb 2 19:44:19 EST 2023 - 283314
Thu Feb 2 19:49:19 EST 2023 - 283311
Thu Feb 2 19:54:19 EST 2023 - 283315     # by the time I got back from the gym, her sync was caught up

So! It appears to do some syncing when logged in “in the background”, but it appears to sync much faster when the logged in user is in the foreground. This is likely some type of CPU and power optimization behavior, something I really don’t want happening on this “server”.

Naturally, I’ll be watching it over the next few weeks to see how in or out of sync it remains over time. Also, I’ll be adding Dropbox into the mix, since that’s the other part of her cloud / backup strategy. I wonder how that will behave…

On the latest Accidental Tech Podcast, they mentioned something called icloud-photos-sync which had been recommended by a listener. It’s a way of syncing your photos from iCloud independently of the Photos.app. I don’t know anything more than that, but it sounded like something that might help with what you’re trying to do.

Very interesting! Thanks for sharing!

Reading his use case and workflow:

I still have questions, but I’m not sure if this is a good fit for me. For one, I’m not using Raw, and don’t want to remove photos from my iCloud Library at this point. I’m enjoying being able to use the Date, People, Places, Keywords, and other filters to navigate 115,000 photos and find the ones I want to view on any device.

His tool will apparently move things to the “native filesystem”, which will strip out most of the convenience I cited in my previous paragraph. He describes Photos as “not easily accessible”; but to me, that app and the way it indexes metadata and allows nagivation is arguably the crown jewel of macOS.

What I’d love to see, however, is someone write a third party tool that can provide better control of the iCloud sync process: keep the sync from going to sleep in the background; make it run when a user isn’t logged in; etc… In theory, such a tool could disassociate a library from a login; it could allow you to specify any number of iCloud credentials which it would use to then sync multiple libraries in parallel (and in the “foreground”), all white logged into a single macOS user account.

But I’d be surprised if Apple allowed such API access, since they probably manage network, CPU, and i/o load in iCloud by throttling traffic. But to the extent some throttling is done on the client side to conserve battery power, perhaps they would allow user apps to override that…

1 Like