The conversation on this page has been archived and is no longer active.

Will croned tasks run while iBook is asleep?

Message #1 - Posted 2001/12/21 - Hobo

If I cron a task to run 3 hours from now and set my iBook to sleep after 1 hour of inactivity and then leave the thing alone will the croned task run?

Message #2 - Posted 2001/12/21 - ZnU

Previously, Hobo wrote:

If I cron a task to run 3 hours from now and set my iBook to sleep after 1 hour of inactivity and then leave the thing alone will the croned task run?

No. Nothing happens in sleep. The CPU isn't even powered. And so far, there's not enough integration between cron and the OS's power management for the system to automatically wake up when there's a job to run.

Under capitalism, man exploits man. Under communism, it's just the opposite. -- J.K. Galbraith

Message #3 - Posted 2001/12/21 - David Baker

in article myusenetclient-016387.01564721122001@cnews.newsguy.com, Hobo at myusenetclient@requiresthis.com wrote on 12/21/01 2:56 AM:

If I cron a task to run 3 hours from now and set my iBook to sleep after 1 hour of inactivity and then leave the thing alone will the croned task run?

No such luck. You have to have the screen go blank (see the Energy control pane), but if the computer goes to sleep your cron jobs won't run.

Message #4 - Posted 2001/12/21 - M. Perry

Previously, Hobo wrote:

If I cron a task to run 3 hours from now and set my iBook to sleep after 1 hour of inactivity and then leave the thing alone will the croned task run?

Nope, nothing runs while your Mac is asleep. Think of it is more like a coma than a light sleep.

--MP

Message #5 - Posted 2001/12/22 - Andrew J. Brehm

ZnU wrote:

Previously, Hobo wrote:

If I cron a task to run 3 hours from now and set my iBook to sleep after 1 hour of inactivity and then leave the thing alone will the croned task run?

No. Nothing happens in sleep. The CPU isn't even powered. And so far, there's not enough integration between cron and the OS's power management for the system to automatically wake up when there's a job to run.

That reminds me, is there any way to wake up an OS X machine via the network?

It doesn't seem to work.

I tried calling the modem, but for some reason it won't detect the ring and wake up either.

Fan of Woody Allen
PowerPC User
Supporter of Pepperoni Pizza

Message #6 - Posted 2001/12/21 - matt neuburg

Previously, M. Perry wrote:

Previously, Hobo wrote:

If I cron a task to run 3 hours from now and set my iBook to sleep after 1 hour of inactivity and then leave the thing alone will the croned task run?

Nope, nothing runs while your Mac is asleep

It's even worse than that: after you Mac wakes up, it won't say, "Oooops, I missed a task while I was asleep, I'd better do it now." A task missed is missed forever. This is why there's MacJanitor; otherwise my Mac would never get to do any periodic cleanup at all. m.

matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt *** REALbasic: The Definitive Guide! 2nd edition! ***
http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt

Message #7 - Posted 2001/12/22 - Morten Reippuert Knudsen

Hobo wrote:

If I cron a task to run 3 hours from now and set my iBook to sleep after 1 hour of inactivity and then leave the thing alone will the croned task run?

just edit the system croontab to run at a time where you know the mac is running - or even better: install "anacron", it will chek if your croonjobs are overdue and run them automaticly.

Venlig hilsen Morten Reippuert Knudsen... snart på iceBook, igen :-)

<icq:131382336> Husk at stemme, forudsat i sætter krydset ved liste B!

Message #8 - Posted 2001/12/22 - Charles Martin

Previously, Andrew J. Brehm wrote:

ZnU wrote:

Previously, Hobo wrote:

If I cron a task to run 3 hours from now and set my iBook to sleep after 1 hour of inactivity and then leave the thing alone will the croned task run?

No. Nothing happens in sleep. The CPU isn't even powered. And so far, there's not enough integration between cron and the OS's power management for the system to automatically wake up when there's a job to run.

That reminds me, is there any way to wake up an OS X machine via the network?

It doesn't seem to work.

I tried calling the modem, but for some reason it won't detect the ring and wake up either.

These are preferences that you can set in the Energy Saver control panel, "wake up on network activity."

_Chas_
(non-spammers should use "chasm" at mac-dot-com instead of the email above!)

"Call me old-fashioned, but I want to read email with an email client, news with a newsreader, and browse with a browser. A Swiss army knife is no substitute for a toolbox." -- Kevin Craig, comp.sys.mac.apps

Message #9 - Posted 2001/12/22 - Laurent Daudelin

In message , Hobo <myusenetclient@requiresthis.com> wrote:

If I cron a task to run 3 hours from now and set my iBook to sleep after 1 hour of inactivity and then leave the thing alone will the croned task run?

I don't think so. Nothing is running when your computer is asleep, not even the processor, I would think. There is power used to maintain the content of the RAM, but that's pretty much it.

-Laurent.
-- ================================================================= Laurent Daudelin Logiciels Nemesys Software mailto:nemesys@mac.com <http://home.cox.rr.com/nemesys> +++++++++++ Sent using an Apple Newton MessagePad 2100 ++++++++++

Message #10 - Posted 2001/12/24 - slavins

Previously, Hobo wrote:

If I cron a task to run 3 hours from now and set my iBook to sleep after 1 hour of inactivity and then leave the thing alone will the croned task run?

No. This is a bug in Unix: it wasn't really designed with computers that can sleep in mind. The fix would be to change the way that 'cron' works so that it could tell it had skipped past the trigger-time for something while asleep and run it soon after it woke up.

This is not just a problem with Darwin, but an underlying problem with all implementations of the Unix 'cron' utility. Various approaches have been taken to fixing it but I don't know if any of them have been widely distributed.

Simon.
--
http://www.hearsay.demon.co.uk | I have a hunch that [] the unknown sequences No junk email please. | of DNA [will decode into] copyright notices

and patent protections. -- Donald E. Knuth

The French Was There.

Message #11 - Posted 2001/12/24 - slavins

Previously, Andrew J. Brehm wrote:

That reminds me, is there any way to wake up an OS X machine via the network?

No. Because to analyse what was happening on the network the machine would have to be awake.

Simon.
--
http://www.hearsay.demon.co.uk | I have a hunch that [] the unknown sequences No junk email please. | of DNA [will decode into] copyright notices

and patent protections. -- Donald E. Knuth

The French Was There.

Message #12 - Posted 2001/12/24 - ZnU

Previously, Simon Slavin wrote:

Previously, Andrew J. Brehm wrote:

That reminds me, is there any way to wake up an OS X machine via the network?

No. Because to analyse what was happening on the network the machine would have to be awake.

Not if the networking hardware supports wake-on-LAN, which it does in recent Macs. But OS X's support for this seems somewhat incomplete.

Under capitalism, man exploits man. Under communism, it's just the opposite. -- J.K. Galbraith

Message #13 - Posted 2001/12/25 - Jeremy

Simon Slavin wrote:

No. This is a bug in Unix: it wasn't really designed with computers that can sleep in mind. The fix would be to change the way that 'cron' works so that it could tell it had skipped past the trigger-time for something while asleep and run it soon after it woke up.

This is not just a problem with Darwin, but an underlying problem with all implementations of the Unix 'cron' utility. Various approaches have been taken to fixing it but I don't know if any of them have been widely distributed.

Well, a real solution isn't quite as simple as just running skipped jobs after waking up. What if, for example, I have something set up to run every hour, and then put the machine to sleep all night? Should cron run it once for each skipped hour, or just once, or do I not care about the skipped jobs and not want them to "catch up" at all?

And what if the machine was asleep, and skipped a bunch of potentially resource-intensive jobs that were "spread out" over the night? Should they all run at once? How is cron to know how to space them out, or whether to do so at all?

So you'd really have to change the crontab syntax in order to "fix" this.

Jeremy | jeremy@exit109.com

Message #14 - Posted 2001/12/27 - slavins

Previously, Jeremy wrote:

Well, a real solution isn't quite as simple as just running skipped jobs after waking up. What if, for example, I have something set up to run every hour, and then put the machine to sleep all night? Should cron run it once for each skipped hour, or just once, or do I not care about the skipped jobs and not want them to "catch up" at all?

Good point. You're right: to implement it correctly you'd have to have a way to saying how you wanted those jobs handled.

Simon.
--
http://www.hearsay.demon.co.uk | I have a hunch that [] the unknown sequences No junk email please. | of DNA [will decode into] copyright notices

and patent protections. -- Donald E. Knuth

The French Was There.

Need Help? Have a Question?

Looking for more help, comments, and answers?

Ask your questions on Ask Different. Ask Different is a community of Apple users ready to help.