This is a collection of commands that can be used to control Time Machine on macOS
Current List (in Progress):
- Schedule TimeMachine interval (CronTab)
-
Create tm_scheduler.sh under any directory you want to keep the file.
vim tm_scheduler.sh
Add script:
#!/bin/sh /usr/bin/tmutil startbackup
-
Create a crontab to run the command
crontab -e
-
In the crontab editor (Default VIM), add the following template in the repo
crontab example.txt
- As a new line, add your crontab command using the template as a guide. To run a shell script, you will need to add /bin/sh in the line. The following command will run at minute 0 of every hour, every day.
0 * * * * /bin/sh /path/to/schedule.sh
- Exit out of Vim while saving on quit (
:wq
) - Check the status of the backup at the top of the hour.
This was a log file that Jim Randell posted on a Stackexchange post. I wanted to put it here for reference in the future.
- Create a file called tm-log.sh
- Paste the contents from the tm-log.sh file in the repo
- Run it
It will continue to monitor for TM status after reporting the last 12 hours of log info.