iBeeZz
Iâve finally sorted out a workable solution for running cron jobs at night on my laptop. The problem is that I donât like leaving the PowerBook awake all night: Heat is pretty damaging to electronic components, and the longer the backlight in the LCD is on, the shorter its life. Itâs also a bit wasteful of energy, and I try to conserve energy whenever I can.
Weâve been using a utility called iBeeZz at work for a while now to shutdown and reboot a desktop machine we use as a server, and Iâve finally got around to installing it on my laptop. The built-in Energy Saver preferences allow you to shutdown the computer at a pre-set time, but you canât wake it from sleep automatically. iBeeZz has a lot of flexibility, and you can wake up, sleep, shutdown or startup at any scheduled time, while varying the behaviour on different days of the week. You can also arrange to quit an application, open a file or an Applescript, or you can launch iTunesâthus turning your Mac into a ludicrously over-priced alarm clock.
The PowerBook sleeps in the spare bedroom overnight, which is next to our bedroom1, so I want to minimise the noise levels. This is what I do:
- At 11:13 pm, an âopen fileâ event quits DesktopEarthPro. I donât need to see the cloud pattern at night, and connecting to the internet to download the image files uses a fair bit of CPU time intermittently. It then also mutes the sound and turns off the screen backlight.
- A âsleepâ even puts the machine to sleep two minutes later, with a warning 5 minutes before so that I can cancel the sleep if Iâm still hard at work (ha!).
- A âwakeâ event wakes the machine at 2:15 am, just in time for the cron jobs to run. My own cron job (to download the zipped backup of this site from the server) is also slotted in.
- A âsleepâ event puts it all back to sleep again at 4:00 am.
- Finally, another âwakeâ event and Applescript wakes the machine, starts up DesktopEarthPro, unmutes the sound and brightens the screen at 6:30 am, ready for me to check my email. In the interests of sanity and having a life, this event is disabled at weekends.
All I need now is a Firewire hard drive that doesnât have a fan that sounds like a 747 on take-off, and I could do my daily backup at night too.
1 Actually, our flat is so small that nowhere inside the flat is very far from our bedroom.

1
For a great drive, check out the drives at http://www.macsales.com/. I bought one of their bare cases to hold a 120Gb drive I bought locally. The case has no fan so it is very quiet. I use it for my iTunes drive and it is on most of the time. The drive "sleeps" when not in use so I think that cuts down on the heat generation. Even when if full use, it generated minimal heat.----- i'm at a loss for words, and maybe that's just as well...
by stacy @ 29/02/2004 8:03 pm • Permalink •
2
There are 2 solutions to automating the late night cron jobs if your Mac is not running 24/7 that I know of. I actually e-mailed you bsag about one of these some time ago but since you did not reply I assume it got caught in your spam filter.
The first is Macaroni ($7 shareware) from http://www.atomicbird.com/. In addition to the cron jobs there is also a couple of bundled perl scripts that enable you to set up a regular Disk Utility repair permissions, and purge your system of any unwanted language support files.
The second is a little freeware open source routine called Anacron which the less geeky can obtain in preconfigured form from http://www.alastairs-place.net/anacron.html. Anyone with an Apple laptop should check this out, and I cannot understand why it is not included in OSX.
by ThoughtBadger @ 29/02/2004 9:02 pm • Permalink •
3
I agree with ThoughtBadger, Anacron is an easier solution than rewaking your machine. Another alternative, given that you wake your machine at 6.30, would be to schedule the tasks to run then (or thereabouts) - that way there'd be no need for the 2.15-4.00am session. As for the repair permissions thing: all you need to do is schedule the following in root's crontab:
diskutil repairPermissions /
... either at a time your machine will be on or let Anacron run it when your machine wakes.
by djn1 @ 01/03/2004 11:03 am • Permalink •
4
Jess: Iâll have a look at them. Bare drives are certainly a lot cheaper. I was toying with the idea of just opening the case up and disconnecting the fan, as the drive gets barely warm, even with prolonged use. But perhaps thatâs asking for trouble.
ThoughtBadger: Grrr. It looks like your email did get caught in a spam filter (Iâve lot a few legitimate emails that way recently)âflippinâ spam. Anyway, I know about Macaroni and anacron (and Cronnix), and they are all excellent solutions. The reason I didnât want to use them in this case (I realise that I should have given a bit more of the back-story to my decision) is because they involve a trade off with the amount of disc and CPU activity that might occur when you are trying to get work done (which is presumably why the UNIX gurus originally settled on the middle of the night to run cron). I wanted to run these tasks automatically, but just rescheduling the regular cron jobs wouldnât work, because there is no free time during the day when I can guarantee that I wonât be using the laptop intensivelyâeven over lunchtime, or when I first start up my laptop :-( So even though my solution was a bit of a fiddle to set up, itâs now requires no intervention, and all the drudgery gets done when I certainly wonât be working
Great tips for people who know that their laptop will be idle at some point, though!
djn1: See above, but youâre rightâmy current schedule is a bit mad! It would simplify the set up a lot to do as you suggest. I donât know why I didnât think of that [blushes].
by bsag @ 01/03/2004 7:03 pm • Permalink •
5
I think that possibly these tasks were originally scheduled to run in the middle of the night so that it would be easier for sys admins looking through the archived logs of the big multiuser academic computers that unix was made for, to know which day they referred to. I have never checked to see how much disk /CPU activity they cause, but am under the impression that it is not actually a very significant amount, and they certainly don't seem to take more than a minute or so to run. Please correct me if I am wrong. I would have thought that if you put Anacron into a boot script, which would ensure that these tasks ran whenever you switched your powerbook on for the first time in the morning, that you would not notice much at all. But I am an amateur in these matters. What do you think djn 1?
by ThoughtBadger @ 01/03/2004 10:04 pm • Permalink •
6
ThoughtBadger: the daily task is reasonably quick (but it does make a noticeble, though not overly troublesome hit on your system). The monthly task doesn't seem to processor intensive either, but from what I can remember the weekly task does cause a more prolonged and noticeable drain on your CPU. I have all three set to run around midnight - my machine is normally still awake, but if I am using it I'm not doing anything too serious.
by djn1 @ 02/03/2004 6:03 am • Permalink •
7
ThoughtBadger: Hmm, you might be right about the scheduling issue.
djn1: I did find that I noticed the activity when I ran jobs during the day, but this discussion with you and ThoughtBadger has made me think that I should probably try again with anacron and just see which method I prefer: thereâs nothing like empirical testing!
by bsag @ 03/03/2004 8:03 pm • Permalink •
8
What do you mean when you say that the Energy Saver preferences wonât allow you to wake the machine from sleep at a scheduled time? They do - the wording âStart up the computerâ might be a little confusing, but it actually means âpower the computer up or wake it from sleep, whatever is necessary.â
But Appleâs support isnât nearly as full-featured as iBeeZz, appaently, so youâre still much better off with the solution youâve devised.
by ethan @ 12/03/2004 4:04 am • Permalink •
9
ethan: No way! I never realised that because of the deceptive wording. You learn something every dayâ¦
by bsag @ 12/03/2004 3:03 pm • Permalink •
Page 1 of 1 pages