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

Westside guy

macrumors 604
Original poster
Oct 15, 2003
6,506
4,605
The soggy side of the Pacific NW
I know we've had various threads about keeping "periodic" jobs running on a portable. The usual solution is to modify the time in your crontab; which certainly works, but has the same potential limitation (your computer has to be on for the jobs to run).

But there's another tool, called anacron, that's been available on Linux for quite a while. Anacron is a better cron because it is not time-of-day dependent. It sets an execution interval for a task; but if the computer isn't running at the right time, anacron makes sure that task will run soon after the computer is powered up. Basically anacron checks job execution time against a minimum selected interval, rather than a set time of day.

What's neat, though, is that there's a package available for download from Apple. All you do is install the package, and it automatically takes your cron jobs and turns them over to anacron. No tweaking is necessary (although you certainly still can play around with it if you want to).

http://www.apple.com/downloads/macosx/unix_open_source/anacron.html

Anacron is also available via fink, but this seems like a better way to do it because of the autoconfiguration.
 
interesting... i don't really care about stuff like keeping cron running on time + i also have heaps of other suff running on my system as well.

something funny though... in the ads below your post there was one that said 'stop using cron. use Avatar'. :D he he. well that got me curious and i searched for it and didn't find anything. :rolleyes:
 
cb911 said:
something funny though... in the ads below your post there was one that said 'stop using cron. use Avatar'. :D he he. well that got me curious and i searched for it and didn't find anything. :rolleyes:

Wow, I can see why Google Ads are supposed to be more effective. :p

I went ahead and clicked on that ad (might as well get some revenue for MR) to get more info. Avatar has one of those pricing pages that says "call for price". :D What's also kinda funny, though, is it's not available for the Mac! It runs on the various *nixes and NT.

Anacron is "free as in beer", as I believe the GNU folks like to say. Hey that does explain a lot about some of those guys...
 
grapes911 said:
Let me get this right. You just install the package and it takes care of the rest. No setting up or editing cron files?

If you go to the home page of the person who packaged anacron for OS X, he explicitly says installing the package does this automatically:

http://www.alastairs-place.net/anacron.html

My cron settings were unchanged from the default - so I don't know for sure if EVERY conceivable cron configuration will get caught. But when I installed the package, it successfully took my existing cron jobs and made them anacron jobs (and commented them out of the cron).
 
Sorry to resurrect such an old thread...

I've installed Anacron and I've read the guy's website and all, but I can't figure out if the program is actually running.:confused:

I am not good w/ computers, so if someone's gonna tell me to use terminal, I'll need to be able to highlight the command, copy, and then paste it directly into terminal.

Thanks in advance!
 
Check /var/log/system.log
This is the log where you'll see when anacron ran scripts. Keep your computer off one night. Turn it on in the morning and let it sit at least 60 minutes (anacron checks every 60 mins for overdue scripts). Check the log. If the periodic daily script ran since you turned it on, then the program is working.

PS. Its a very good program. I'd bet it's working.
 
"Sorry to resurrect such an old thread" Damn, no wonder I couldn't find the link at the top - I really should learn to read the dates on these threads more!
 
grapes911 said:
Check /var/log/system.log
This is the log where you'll see when anacron ran scripts. Keep your computer off one night. Turn it on in the morning and let it sit at least 60 minutes (anacron checks every 60 mins for overdue scripts). Check the log. If the periodic daily script ran since you turned it on, then the program is working.

PS. Its a very good program. I'd bet it's working.
Do I type /var/log/system.log into terminal? Where can I check the log? I told you I'm seriously computer illiterate. Sigh. But I'm trying my bestest.:eek:
 
devilot76 said:
Do I type /var/log/system.log into terminal? Where can I check the log? I told you I'm seriously computer illiterate. Sigh. But I'm trying my bestest.:eek:

In the terminal type
less /var/log/system.log
You can use the arrows to go up and down.
 
devilot76 said:
I've installed Anacron and I've read the guy's website and all, but I can't figure out if the program is actually running.:confused:

At the command line type:

grep anacron /var/log/system.log

You should see a response similar to this:

huxley:~ risc$ grep anacron /var/log/system.log
Jul 21 00:29:21 huxley anacron[26736]: Job `cron.daily' terminated
Jul 21 00:29:21 huxley anacron[26736]: Normal exit (1 jobs run)
Jul 21 01:24:19 huxley anacron[26825]: Anacron 2.3 started on 2005-07-21
Jul 21 01:24:19 huxley anacron[26825]: Normal exit (0 jobs run)
huxley:~ risc$

Since this post has been resurrected from the past here are the anacron links for this interested:

Anacron for Tiger: http://members.cox.net/18james/anacron-tiger.html
Anacron for Panther/Jaguar: http://www.alastairs-place.net/anacron.html
 
grapes911 said:
In the terminal type
less /var/log/system.log
You can use the arrows to go up and down.
Thanks! Hahah, now if only I could decipher all that text. Eh, I saw "cron" in there somewhere and 1 job done. So I'll just assume it's doing its job. Thanks again, grapes!:D
 
devilot76 said:
Thanks! Hahah, now if only I could decipher all that text. Eh, I saw "cron" in there somewhere and 1 job done. So I'll just assume it's doing its job. Thanks again, grapes!:D

See my post above about using grep, you don't want to use less here. :)
 
risc said:
See my post above about using grep, you don't want to use less here. :)
uhh oh... I had already used the "less" method first... am I screwed? (By the way, I tried "grep" thingie and that makes more sense.)
 
devilot76 said:
uhh oh... I had already used the "less" method first... am I screwed? (By the way, I tried "grep" thingie and that makes more sense.)

less is just a command to look at text you haven't broken anything by looking at your system.log file, you just got to look at a bunch of stuff you didn't want to see. grep is another command which can do many things but here I've just got it to check the file to look at the system.log and report back only when there is a reference to anacron.

If you aren't sure about a command someone tells you to run from the terminal type man $COMMAND-NAME (ie man grep) and it'll explain the command to you in more detail (some times too much detail ;))

Just don't go round editing or removing files and you'll be fine.
 
Status
Not open for further replies.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.