14.8 C
New York
Sunday, April 27, 2025

purposes – Forestall com.apple.find from scanning my Time Machine drive?


After digging into this additional myself I discovered that the com.apple.find process (/System/Library/LaunchDaemons/com.apple.find.plist) launches a script at /usr/libexec/find.updatedb.

It seems inside that script that Time Machine volumes are supposed to be excluded, nevertheless the trail for matching them is */Backups.backupdb" which solely matches old-style (HFS+) Time Machine volumes, as APFS Time Machine volumes are structured very otherwise.

The proper answer to this downside could be to offer completely different exclusion guidelines, however each the launchd process and script are lined by System Integrity Safety, although there’s a means round this.

One other a part of the issue is that backupd has a behavior of leaving snapshots mounted underneath /Volumes/.timemachine when it now not wants them, which seems to be the place the discover course of is getting caught, so unmounting these gives one other attainable answer.

So this offers two attainable options (each would require you to be logged in as root to do that, if you do not know how or are usually not comfy with the command line then you might simply have to attend for Apple to repair this):

Add Customized Exclusions to /usr/libexec/find.updatedb

  1. Copy /usr/libexec/find.updatedb to a different location (akin to /usr/native/lib)
  2. Discover the road: : ${PRUNEPATHS="/non-public/tmp /non-public/var/folders /non-public/var/tmp */Backups.backupdb"} # undesirable directories
  3. After */Backups.backupdb add /Volumes/.timemachine like so: : ${PRUNEPATHS="/non-public/tmp /non-public/var/folders /non-public/var/tmp */Backups.backupdb /Volumes/.timemachine"} # undesirable directories
  4. Copy /System/Library/LaunchDaemons/com.apple.find.plist to /Library/LaunchDaemons
  5. Edit /Library/LaunchDaemons/com.apple.find.plist to level to your customized script (/usr/libexec/find.updatedb to /usr/native/lib/find.updatedb).
  6. Unload the previous process utilizing: launchctl unload -w /System/Library/LaunchDaemons/com.apple.find.plist
  7. Load your substitute process utilizing: launchctl load /Library/LaunchDaemons/com.apple.find.plist

OR

Unmount Leftover Snapshots

  1. Flip off computerized Time Machine backups in System Preferences.
  2. Create a launchd process that may set off Time Machine, and cleanup snapshot mounts afterwards (see under for a pattern process).
  3. Load the launchd process with: launchctl load /Library/LaunchDaemons/customized.backup.plist

/Library/LaunchDaemons/customized.backup.plist

<?xml model="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist model="1.0">
<dict>
    <key>Label</key>
    <string>customized.backup</string>
    <key>ProgramArguments</key>
    <array>
        <string>bash</string>
        <string>-c</string>
        <string><![CDATA[
if tmutil startbackup --auto --block --rotation; then
    mount | grep -o '/Volumes/.timemachine/.*.backup' | while read mountpoint; do
        diskutil unmount ${mountpoint}
    done
fi
]]></string>
    </array>
    <key>StartCalendarInterval</key>
    <dict>
        <string>Minute</string>
        <integer>0</integer>
    </dict>
</dict>
</plist>

It will run Time Machine each hour, on the hour (or after waking, in case your laptop was asleep on the time), and after working efficiently it is going to search for all snapshots mounted underneath /Volumes/.timemachine and attempt to unmount them, so com.apple.find will not be capable of index them.

Whereas this feature is somewhat cleaner (and is helpful in order for you extra management over when Time Machine runs and what occurs earlier than and after it does) it has the draw back of timing since there is no assure com.apple.find will not run whereas snapshots are nonetheless mounted, although with the mounts being cleaned up the possibility of that needs to be low.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles