Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

How can I make my Macbook automatically shutdown after a Time Machine backup?

I have a 40GB worth backup to do but I keep having to cancel it to go to bed. Would be great if I could leave it on to do it overnight.

Any suggestions of how to do this in ML?

share|improve this question
Why do you have to cancel it to go to bed? –  Gerry Sep 11 '12 at 20:16
Because I wouldn't want my Macbook on all night incase of overheating –  Jamesking56 Sep 11 '12 at 20:19
Once it idles, it will go to sleep. You are overthinking this one. –  Gerry Sep 11 '12 at 20:21
Set it to sleep even with power on after X minutes and let it run until done? –  Thorbjørn Ravn Andersen Sep 11 '12 at 20:21
Doesn't sleeping still use a considerable amount of power resources? –  Jamesking56 Sep 11 '12 at 20:29

2 Answers 2

up vote 1 down vote accepted

You could setup a crontab to use tmutil through the command line to do a backup and then shutdown. since shutdown requires sudo privs, you have to set your crontab up as sudo.

sudo crontab -e

Enter your password and then that brings you to edit the contab file

shutdown -h now

Shutdown does exactly that but with the -h flag, it halts the system (shutdown). For the shutdown to work, this would have to be setup as an crontab under sudo

tmutil startbackup

Starts the timemachine backup.

Putting it all together:

00 20 ** ** ** tmutil startback --block; shutdown -h now

Would do thebackup at 10:00pm every day and then shutdown

share|improve this answer
Looking at the post by @da4 you could replace rsync with tmutil. I was unaware of their command line tool –  slowBear Sep 11 '12 at 21:56

Assuming you have already set a destination for your TM, you could open a shell in Terminal (or ssh in), sudo su into super-user mode, then run tmutil startbackup --block;shutdown -h now;exit which tells TM to begin a backup immediately, turn off the Mac, and exit the shell. man tmutil for more info.

You could also then add this as a launchctl item or even cron it to schedule.

share|improve this answer
Be careful with this. I plugged my time machine drive in and ran this command. The time machine backup was already being prepared, so the tmutil errored out (saying a backup was in progress) and then the shutdown command was issued (which froze my laptop for some reason, I had to do a hard reset). Trying again now with no backup being prepared, fingers crossed! –  Chris Parton Jan 19 at 11:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.