Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Kentuckienne

macrumors regular
Original poster
Sep 19, 2013
161
9
No>me<where
I'm on a metered connection with a limit of 10 GB per month. I get unlimited data between midnight and 5 AM, so I would like to schedule software downloads, updates, etc. to kick off then. But I can't find any way to schedule an update - either they are automatic or manual. So I get up after midnight to do updates.

I'm on the Exede satellite platform and it's very fast (12 MB download speed) except when I go to the App store to download updates .... then it takes forever, and it seems to be related to Apple only. Any other website or download is blazing, but App store slow as molasses. Some nights it's fine, other nights it's awful. If I could schedule the updates, then kill them if they are still running at 5, it would make my life a lot easier. But I can't find any tools to do this. Any advice?
 
First disable automatic updates in System Preferences.

Now open the Terminal application and type:
Code:
sudo bash
to log in as root. It'll ask for your password, but letters won't show as you type them. Keep typing and hit enter when you're done.

(You can skip this next one if you know what you're doing)
Code:
export EDITOR=nano

Now type:
Code:
crontab -e
and hit enter.

This will open the cron schedule for the root user. This lists commands that should be run at certain times and will probably be empty. Start typing:
Code:
0 0 * * * softwareupdate --install
0 5 * * * killall softwareupdate
The spaces between the numbers and asterisks are important. Press ctrl+o then enter, then ctrl+x to save and exit. You can close Terminal now.

That cron schedule runs software update at midnight and then kills it at 05:00 if it's still running.
 
  • Like
Reactions: Significant1
Oh, that's just what I wanted! I remembered from a past life running Cron jobs on Xenix. Or whatever flavor it was back then on the TANDY RADIO SHACK COMPUTER with not one, but TWO enormous floppy drives, named Flip and Flop. It's coming back to me ... there was vi ... and nroff ... and C without any plus plusses ... man, I am old.

Thanks for the point in the right direction. This is just what I need.
 
It didn't work ... nothing is updating. I didn't stay up until midnight to see what happened - wait, just read some do, think those are supposed to be tabs between the asterisks/items, not spaces. I'll try again. Ah, and also I read that the jobs won't execute when the computer is asleep, so I found an option under power mode to wake it up every day at 11:30 pm and put it back to sleep at 5:30 am. Let's see if those two fixes work.
 
Last edited:
It didn't work ... nothing is updating. I didn't stay up until midnight to see what happened - wait, just read some do, think those are supposed to be tabs between the asterisks/items, not spaces. I'll try again. Ah, and also I read that the jobs won't execute when the computer is asleep, so I found an option under power mode to wake it up every day at 11:30 pm and put it back to sleep at 5:30 am. Let's see if those two fixes work.

Quite right, now you mention it. Cron is a Unix tool and isn't really supposed to be used on OS X. launchd is the right tool for this job. See this tutorial: http://launchd.info
 
Maybe that's it. I did read that in the man pages, that cron has been deprecated, and changing the settings to wake up the computer didn't work. So I'll read up on launchd and see if I can figure it out. Thanks.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.