Which sets a repeating wake event for 12:57am every day of the week. However, if that would work for you, I recommend trying that out because it’s easier. I didn’t go this route because I didn’t want it to wake up a shutdown Mac which might not be plugged in and then my wife would wake up to a dead laptop ( not good for my reputation! :)). I think you can do this via the Energy Saver (“Battery” in macOS 12.x) System Preferences pane under “Schedule” (for macOS 12.x) by selecting the “Startup or wake” checkbox and picking “Every Day” and the time you chose above. This is because if it’s too slow sometimes Time Machine on this old version of macOS will decide that “the backup destination isn’t available” and it will fail. Now all you need to do is make sure your Mac is awake at 12:59am □Ī note about the time: Since waking up triggers connecting to the network which triggers auto-fetching of mail, likely calendar syncing, and who knows what other Apple stuff and this was an old and slow Mac, I chose to wake it up at 12:57am so it would have 2 minutes to complete all of the network stuff before the Time Machine backup tried to start.Note 2: If this doesn’t work, try running it via sudo and you’ll get more verbose error messages. Note 1: If you don’t know what your uid (User ID) is (it’s the number after “gui” in the service domain target argument above), you can use launchctl manageruid command to find out. Launchctl bootstrap gui/501/ /Users/dad/Library/LaunchAgents/ If doing this manually with a text editor, you’ll need to save this file into ~/Library/LaunchAgents/ and then you’ll need to tell launchd about it via something like:.Name your file something that makes sense to you, I matched the file name to the label, so: “” is what I used. The easiest way is to use LingonX, but you can create the file in a text editor like the excellent BBEdit and may want to refer to this very helpful documentation for launchd. Now create a LaunchAgent file for your task.Decide what time you want your daily backup to run.Run the first backup to each destination – either manually (via right-click on the destination drive icon in System Preferences > Time Machine view), or automatically by enabling “Back Up Automatically” in Time Machine settings and then waiting until they’ve both completed their first backup (don’t forget to turn off automatic once the first backup to each has run!).First step – create the Time Machine backup destinations in the Time Machine settings inside System Preferences.Use Energy Saver / Battery settings, or pmset repeat wake with appropriate time and days to wake up the computer a couple of minutes before that crontab command trigger time.use sudo launchctl bootstrap gui/501/ /Users/ to get the system to load and enable your.Create a LaunchAgent plist to invoke tmutil startbackup -auto -rotation at the desired time.Use System Preferences > Security & Privacy > Full Disk Access to give /usr/sbin/cron full disk access.Use crontab to setup a daily call to tmutil startbackup -auto -rotation.Option 1 (described in an addendum since launchd is preferred by Apple):.Run a first backup to each backup destination.Thus, it was clear I needed a way to automate this. I tried just having her run a backup manually when she was done for the day, but she’s tired then and so backups weren’t happening regularly at all. We still wanted to back it up to the two TimeCapsules we have though. My wife is using an older MacBook Air from late 2010 1 and it can’t handle a Google Meet meeting, Chrome with a bunch of tabs open, and a Time Machine backup (all over WiFi) without the video meeting having trouble. Documentation on how to use cron is in an addendum in case you prefer that. This seems less than ideal from a security perspective, so I’ve move to using launchd via a LaunchAgent plist file. Update: So in macOS 12 (and likely v11 and maybe v10) you have to give cron Full Disk Access for it to work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |