1

After seeing mathiasbynens' dotfiles, I've decided that I want to start building a script to configure all my system preferences to my liking.

As part of this, I need to decrease the Time Machine update rate (in order to reduce wear levels on my NAS' hard disk).

After doing some reading online [1], I have concluded that the file I need to edit is /System/Library/LaunchDaemons/com.apple.backupd-helper.plist.

I know that this is possible via the defaults command. Here is the section of the file I want to change:

$ defaults read /System/Library/LaunchDaemons/com.apple.backupd-helper LaunchEvents
{
    "com.apple.xpc.activity" =     {
        "com.apple.backupd-auto" =         {
            AllowBattery = 1;
            Delay = 3600;
            GracePeriod = 1800;
            Interval = 3600;
            PowerNap = 1;
            Priority = Utility;
            Repeating = 1;
        };
    };
}

The problem is that, due to the dots (.) in the path to the Delay property, I cannot figure out how to specify said path directly.

I have tried LaunchEvents.\"com.apple.xpc.activity\", 'LaunchEvents."com.apple.xpc.activity"', and many variations thereof.

[1] https://staff.eecis.udel.edu/docs/timemachine/frequency/

user196499
  • 106
  • 1
  • 6

2 Answers2

0

I took a copy of /System/Library/LaunchDaemons/com.apple.backupd-helper.plist and saved it elsewhere as a.plist:

cp "/System/Library/LaunchDaemons/com.apple.backupd-helper.plist" /tmp/a.plist

Then I played around with PlistBuddy until I got this which seems to work:

/usr/libexec/PlistBuddy -c "Set :LaunchEvents:com.apple.xpc.activity:com.apple.backupd-auto:Interval 7200" /tmp/a.plist 
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
0

Vaguely related to the original topic, it is way more flexible to disable time machine's auto scheduling and replace it with either TimeMachineEditor or simply create a launchd(8) rule. Eg. via LaunchControl enter image description here

TheMadsen
  • 196
  • 1
  • 11