Anacron - neat tool, neat package

Discussion in 'Mac Apps and Mac App Store' started by Westside guy, Apr 9, 2004.

Thread Status:
Not open for further replies.
  1. Westside guy macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy side of the Pacific NW
    #1
    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.
     
  2. cb911 macrumors 601

    cb911

    Joined:
    Mar 12, 2002
    Location:
    BrisVegas, Australia
    #2
    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:
     
  3. Westside guy thread starter macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy side of the Pacific NW
    #3
    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...
     
  4. grapes911 Moderator emeritus

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #4
    Let me get this right. You just install the package and it takes care of the rest. No setting up or editing cron files?
     
  5. Westside guy thread starter macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy side of the Pacific NW
    #5
    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).
     
  6. devilot Moderator emeritus

    devilot

    Joined:
    May 1, 2005
    #6
    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!
     
  7. grapes911 Moderator emeritus

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #7
    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.
     
  8. hob macrumors 68020

    hob

    Joined:
    Oct 4, 2003
    Location:
    London, UK
    #8
    "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!
     
  9. devilot Moderator emeritus

    devilot

    Joined:
    May 1, 2005
    #9
    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:
     
  10. grapes911 Moderator emeritus

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #10
    In the terminal type
    less /var/log/system.log
    You can use the arrows to go up and down.
     
  11. risc macrumors 68030

    risc

    Joined:
    Jul 23, 2004
    Location:
    Melbourne, Australia
    #11
    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
     
  12. devilot Moderator emeritus

    devilot

    Joined:
    May 1, 2005
    #12
    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
     
  13. risc macrumors 68030

    risc

    Joined:
    Jul 23, 2004
    Location:
    Melbourne, Australia
    #13
    See my post above about using grep, you don't want to use less here. :)
     
  14. devilot Moderator emeritus

    devilot

    Joined:
    May 1, 2005
    #14
    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.)
     
  15. grapes911 Moderator emeritus

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #15
    Yeah, sorry. I wasn't thinking. risc gave you a much better method. :eek:
     
  16. risc macrumors 68030

    risc

    Joined:
    Jul 23, 2004
    Location:
    Melbourne, Australia
    #16
    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.
     
  17. devilot Moderator emeritus

    devilot

    Joined:
    May 1, 2005
    #17
    Whew. Thanks to the both of you! You guys rock! :cool:
     
  18. Westside guy thread starter macrumors 601

    Westside guy

    Joined:
    Oct 15, 2003
    Location:
    The soggy side of the Pacific NW
    #18
    Note that, for Tiger, there's a different anacron package that sets itself up using the new launchd system:

    http://members.cox.net/18james/anacron-tiger.html

    The other one will still work since it schedules itself through cron, and cron does work in Tiger (at least it does in 10.4.2 - launchd has had problems in earlier versions, and didn't always seem to keep cron running).
     
Thread Status:
Not open for further replies.

Share This Page