I'd like to exclude specific times where Time Machine should not run. This is so that I can create an off-site backup of the Time Machine backup for disaster recovery purposes. I don't want a TM backup running while making this backup as it may create a copy in an inconsistent state.
I realize there are tools that allow you to do this, but all require you to disable the Apple Time Machine scheduler, which I prefer to not to do. I'd also prefer not to install software I do not know or trust. Therefore, I'm looking for a command line solution to prevent Time Machine backups from occurring from 12AM to 6AM.
I took a look at tmutil man pages and didn't see any way of including or excluding run times. However, I did see that one can stopbackup
, disable
, and enable
the service using this utility. So perhaps, there's a way to easily schedule these commands to run at certain times? For example:
Run these commands at 12:00AM:
sudo tmutil disable
sudo tmutil stopbackup
Then turn things back on at 6:00AM:
sudo tmutil enable
I tried using iCal with those commands in an .sh
file, but nothing happen. I read about launchd
, but I'm out of my comfort zone with getting that going, especially since these need to run as root.