Thursday, 28 August 2025

Solving Mac Time Machine backup hanging when computer is in screen lock mode

After a recent operating system update, my Mac Time Machine backup stopped working.
Or rather, it would only work if the Mac was active and the screen not locked.

It was getting stuck on about 25% progress.

It was quite tricky finding out the reason. In the end, this blog post and discussion explained how to show Time Machine errors and identify files that were locked and inaccessible.
The practical fix was to add that directory to the exclude list for Time Machine.

1) https://www.aaron.cc/troubleshooting-time-machine-backup-issues-on-a-locked-mac/

The command to show lock errors

$ log show --info --style compact --predicate '(subsystem == "com.apple.TimeMachine") && (eventMessage like[cd] "Failed * acquire device lock assertion*")' --last 24h

It shows a problem directory /Users/peter/Library/Daemon Containers/01DA2190-87F5-48BA-BCC7-B39703EF4ABC/Data/com.apple.milod

where the data files are locked.

milod appears to be some bluetooth micro location discovery for keyboards.


2025-08-27 20:51:58.031 E  backupd[331:1db3f] [com.apple.TimeMachine:FileProtection] Failed to acquire device lock assertion for '/Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/PeterEdwards (3)/2025-08-27-205126/Data/Users/peter/Library/Daemon Containers/01DA2190-87F5-48BA-BCC7-B39703EF4ABC/Data/com.apple.milod/milo.db' (assertion state: <dropped>), error: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"

2) https://forums.macrumors.com/threads/does-this-file-exist-for-you-milod-service.2430197/

The command to exclude that directory from backups.

You have to go to Settings / Full Disk Access and allow Terminal full disk access, then in Terminal run

$ sudo tmutil addexclusion -p '/Users/peter/Library/Daemon Containers/01DA2190-87F5-48BA-BCC7-B39703EF4ABC/Data/com.apple.milod'

Then take away full disk access again.

You should see the exclusion by going to System Settings -> General -> Time Machine and clicking on the Options button.

Now my backup works again.

No comments: