Automator recipe to speed up backups in Time Machine

Backups on my MacBook Pro (15-inch Late 2016) with macOS Catalina 10.15.3 are ridiculously slow. If I disable the low priority for my backups from the terminal with sudo sysctl debug.lowpri_throttle_enabled=0, the speed of this service turns to be more reasonable. However, I do not want to harm the performance of the CPU while I am not doing backups nor I want to have to run that command every time I want to do a backup.

In fact, I scheduled a daily backup with TimeMachineEditor at night when my laptop is asleep, so I was wondering if it would be possible to create a recipe for Automator to launch this command just before TimeMachineEditor run Time Machine and also do a sudo sysctl debug.lowpri_throttle_enabled=1 when the backup is finished. Of course, user permission should be included in the recipe to avoid to enter the sudo password in the middle of the night. If so, how would this recipe look like? Thx.


launchd

Use launchd to run your two commands at specific times. By placing a launchd job in /Library/LaunchDaemons you can avoid needing sudo as the command can be run as root with this location.

See a launchd tutorial for getting started with launchd and step by step guides.

Determining whether Time Machine has finished must be handled by a script. The simplest solution is to re-enable low priority throttling at a specific time.

Third Party Tools

Alternatively, you can use a wide range of third party scheduling tools on macOS. These include the one I work on, Power Manager, which can run scripts at set times each day as root.