Ask a Question related to Ubuntu, Design and Development.

  1. #1

    Default cron v anacron

    Newbie here, running Ubuntu 5.10.

    I understand cron and crontab, but crontab only runs /etc/cron.hourly,
    anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.

    At what time does anacron run /etc/cron.daily?

    Why doesn't anacron show up when I do ps aux | grep anacron?
    Dean DeBruin Guest

  2. Similar Questions and Discussions

    1. cron job
      If the cron job run every 15 minute, it will fill up mail box. Does anyone has any idea. Thanks "Davide Bianchi" <davideyeahsure@onlyforfun.net>...
    2. rsh and cron
      I have Ultra 60 with Solaris 2.6, and the rsh always work fine, until recently I foud the rsh does not work on the Ultra 60. But I don't have any...
    3. cron
      Not specific to PHP really, but it all started with a simple PHP script I was automating... I've used cron/crontab on a zillion machines, and it...
    4. CRON: bad user
      Hi all, I just noticed the same messages in the cron-log: ! bad user (root) After reading this topic I looked at the shadow-file. I noticed...
    5. cron log ts=139 errors
      In article <bdihf501khu@enews1.newsguy.com>, Scott Shinault <shinault@aracnet.com> wrote: I have always assumed that "ts" stood for "terminated...
  3. #2

    Default Re: cron v anacron

    Dean DeBruin wrote:
    > Newbie here, running Ubuntu 5.10.
    >
    > I understand cron and crontab, but crontab only runs /etc/cron.hourly,
    > anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
    >
    > At what time does anacron run /etc/cron.daily?
    >
    > Why doesn't anacron show up when I do ps aux | grep anacron?
    Does anacron only run at startup? That would explain some things, but
    then there are problems with crontab...
    Dean DeBruin Guest

  4. #3

    Default Re: cron v anacron

    On 2006-02-28, Dean DeBruin <deandb@nospam.com> wrote:
    > Newbie here, running Ubuntu 5.10.
    >
    > I understand cron and crontab, but crontab only runs /etc/cron.hourly,
    > anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
    >
    > At what time does anacron run /etc/cron.daily?
    >
    > Why doesn't anacron show up when I do ps aux | grep anacron?
    You can use cron to run things daily, weekly and monthly.

    type
    $ crontab -e
    to edit your crontab file.

    This is a separate thing to the scripts in /etc/cron.* and is more
    adaptable to your personal needs, I find.

    * * * * * command to be executed
    - - - - -
    | | | | |
    | | | | +----- day of week (0 - 6) (Sunday=0)
    | | | +------- month (1 - 12)
    | | +--------- day of month (1 - 31)
    | +----------- hour (0 - 23)
    +------------- min (0 - 59)

    --
    -Toby, who...
    Add the word afiduluminag to the subject
    field to circumvent my email filters.
    Ignore any mail delivery error.
    Toby Newman Guest

  5. #4

    Default Re: cron v anacron

    Toby Newman wrote:
    > On 2006-02-28, Dean DeBruin <deandb@nospam.com> wrote:
    >
    >>Newbie here, running Ubuntu 5.10.
    >>
    >>I understand cron and crontab, but crontab only runs /etc/cron.hourly,
    >>anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
    >>
    >>At what time does anacron run /etc/cron.daily?
    >>
    >>Why doesn't anacron show up when I do ps aux | grep anacron?
    >
    >
    > You can use cron to run things daily, weekly and monthly.
    >
    > type
    > $ crontab -e
    > to edit your crontab file.
    >
    > This is a separate thing to the scripts in /etc/cron.* and is more
    > adaptable to your personal needs, I find.
    >
    > * * * * * command to be executed
    > - - - - -
    > | | | | |
    > | | | | +----- day of week (0 - 6) (Sunday=0)
    > | | | +------- month (1 - 12)
    > | | +--------- day of month (1 - 31)
    > | +----------- hour (0 - 23)
    > +------------- min (0 - 59)
    >
    Thank you, I'll look into that.

    I was trying to run a system-wide daily backup script. I put a link to
    it in /etc/cron.daily but it didn't run so I tried to figure out
    /etc/crontab.

    My /etc/crontab has the following lines:
    > 17 * * * * root run-parts --report /etc/cron.hourly
    > 25 6 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
    > 47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
    > 52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly
    As far as I can figure out (by reading man pages and by testing)
    run-parts runs hourly, but for the daily, weekly, and monthly lines it
    will only run if /usr/sbin/anacron does NOT exist! Am I missing something?

    /usr/sbin/anacron DOES exist so I removed "test -x /usr/sbin/anacron ||"
    from the daily, weekly, and monthly lines and now it seems to work.
    Dean DeBruin Guest

  6. #5

    Default Re: cron v anacron

    On 2006-02-28, Dean DeBruin <deandb@nospam.com> wrote:
    > Toby Newman wrote:
    >> On 2006-02-28, Dean DeBruin <deandb@nospam.com> wrote:
    >>
    >>>Newbie here, running Ubuntu 5.10.
    >>>
    >>>I understand cron and crontab, but crontab only runs /etc/cron.hourly,
    >>>anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
    >>>
    >>>At what time does anacron run /etc/cron.daily?
    >>>
    >>>Why doesn't anacron show up when I do ps aux | grep anacron?
    >>
    >>
    >> You can use cron to run things daily, weekly and monthly.
    >>
    >> type
    >> $ crontab -e
    >> to edit your crontab file.
    >>
    >> This is a separate thing to the scripts in /etc/cron.* and is more
    >> adaptable to your personal needs, I find.
    >>
    >> * * * * * command to be executed
    >> - - - - -
    >> | | | | |
    >> | | | | +----- day of week (0 - 6) (Sunday=0)
    >> | | | +------- month (1 - 12)
    >> | | +--------- day of month (1 - 31)
    >> | +----------- hour (0 - 23)
    >> +------------- min (0 - 59)
    >>
    >
    > Thank you, I'll look into that.
    >
    > I was trying to run a system-wide daily backup script. I put a link to
    > it in /etc/cron.daily but it didn't run so I tried to figure out
    > /etc/crontab.
    >
    Another way would be to type
    $ crontab -e
    to edit your user's crontab and add the following in order to run a
    script at 4am each day:

    shell=/bin/sh
    MAILTO=yourEmailAddress@invalid.com.invalid
    0 4 * * * /path/to/script --AnySwitches

    --
    -Toby, who...
    Add the word afiduluminag to the subject
    field to circumvent my email filters.
    Ignore any mail delivery error.
    Toby Newman Guest

  7. #6

    Default Re: cron v anacron

    * Toby Newman wrote in alt.os.linux.ubuntu:
    > Another way would be to type
    > $ crontab -e
    > to edit your user's crontab and add the following in order to run a
    > script at 4am each day:
    >
    > shell=/bin/sh
    > MAILTO=yourEmailAddress@invalid.com.invalid
    > 0 4 * * * /path/to/script --AnySwitches
    Wont that only run it on Sunday's @ 4?

    --
    David
    SINNER Guest

  8. #7

    Default Re: cron v anacron

    * Toby Newman wrote in alt.os.linux.ubuntu:
    > Another way would be to type
    > $ crontab -e
    > to edit your user's crontab and add the following in order to run a
    > script at 4am each day:
    >
    > shell=/bin/sh
    > MAILTO=yourEmailAddress@invalid.com.invalid
    > 0 4 * * * /path/to/script --AnySwitches
    never mind...DOH!

    --
    David
    SINNER Guest

  9. #8

    Default Re: cron v anacron

    Dean DeBruin schrieb:
    > Toby Newman wrote:
    [...]
    > My /etc/crontab has the following lines:
    >
    >> 17 * * * * root run-parts --report /etc/cron.hourly
    >> 25 6 * * * root test -x /usr/sbin/anacron || run-parts --report
    >> /etc/cron.daily
    >> 47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report
    >> /etc/cron.weekly
    >> 52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report
    >> /etc/cron.monthly
    >
    >
    > As far as I can figure out (by reading man pages and by testing)
    > run-parts runs hourly, but for the daily, weekly, and monthly lines it
    > will only run if /usr/sbin/anacron does NOT exist! Am I missing something?
    >
    > /usr/sbin/anacron DOES exist so I removed "test -x /usr/sbin/anacron ||"
    > from the daily, weekly, and monthly lines and now it seems to work.
    -x means:
    check for the existence AND check wether it is executable

    so, if /usr/sbin/anacron exists and is executable it will be executed
    otherwise run-parts --report will be executed.

    Torsten
    Torsten Flammiger Guest

  10. #9

    Default Re: cron v anacron

    Dean DeBruin <deandb@nospam.com> wrote:
    > Newbie here, running Ubuntu 5.10.
    >
    > I understand cron and crontab, but crontab only runs /etc/cron.hourly,
    > anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
    anacron "cannot currently be used to schedule commands at intervals smaller
    than days" as the README.gz says
    > At what time does anacron run /etc/cron.daily?
    >
    > Why doesn't anacron show up when I do ps aux | grep anacron?
    anacron runs at startup and is executed each morning by cron (see
    /etc/crontab). It's not a daemon so it doesn't show up in ps after it
    has finished today's work.


    Florian
    --
    Das ist ja das positive am usenet: man erfährt oft Dinge, nach denen
    gar nicht gefragt wurde.
    [Konrad Wilhelm in <lsght1hho14bbe7in8q9currhtc7vuqfru@4ax.com>]
    Florian Diesch Guest

  11. #10

    Default Re: cron v anacron

    Torsten Flammiger wrote:
    > Dean DeBruin schrieb:
    >
    >>Toby Newman wrote:
    >
    >
    > [...]
    >
    >
    >>My /etc/crontab has the following lines:
    >>
    >>
    >>>17 * * * * root run-parts --report /etc/cron.hourly
    >>>25 6 * * * root test -x /usr/sbin/anacron || run-parts --report
    >>>/etc/cron.daily
    >>>47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report
    >>>/etc/cron.weekly
    >>>52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report
    >>>/etc/cron.monthly
    >>
    >>
    >>As far as I can figure out (by reading man pages and by testing)
    >>run-parts runs hourly, but for the daily, weekly, and monthly lines it
    >>will only run if /usr/sbin/anacron does NOT exist! Am I missing something?
    >>
    >>/usr/sbin/anacron DOES exist so I removed "test -x /usr/sbin/anacron ||"
    >>from the daily, weekly, and monthly lines and now it seems to work.
    >
    >
    > -x means:
    > check for the existence AND check wether it is executable
    >
    > so, if /usr/sbin/anacron exists and is executable it will be executed
    > otherwise run-parts --report will be executed.
    >
    > Torsten
    As far as I can tell, "test -x file"only checks the existence of the
    file and whether it is executable. It does not execute the file. The
    following experiment seems to support that idea.

    dean@ubuntu:~$ ls -l ./hello
    -rwxr-xr-x 1 dean dean 31 2006-02-28 23:10 ./hello
    dean@ubuntu:~$ ./hello
    hello, world
    dean@ubuntu:~$ test -x ./hello
    dean@ubuntu:~$ test -x ./hello || echo goodbye
    dean@ubuntu:~$

    The above experiment also shows that cron would not execute the daily,
    weekly, and monthly lines in /etc/crontab.
    Dean DeBruin Guest

  12. #11

    Default Re: cron v anacron

    Florian Diesch wrote:
    > Dean DeBruin <deandb@nospam.com> wrote:
    >
    >>Newbie here, running Ubuntu 5.10.
    >>
    >>I understand cron and crontab, but crontab only runs /etc/cron.hourly,
    >>anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
    >
    >
    > anacron "cannot currently be used to schedule commands at intervals smaller
    > than days" as the README.gz says
    >
    >
    >>At what time does anacron run /etc/cron.daily?
    >>
    >>Why doesn't anacron show up when I do ps aux | grep anacron?
    >
    >
    > anacron runs at startup and is executed each morning by cron (see
    > /etc/crontab). It's not a daemon so it doesn't show up in ps after it
    > has finished today's work.
    Yes, I finally figured out that anacron runs at startup and then exits.
    It is not a daemon. However, it is not executed each morning by cron,
    nor should it be.

    Anacron is intended to run at startup to catch those jobs missed by cron
    while the computer is shut down. If cron is running, there is no need
    for it to run anacron. I contend that the "test -x /usr/sbin/anacron
    ||" does not belong in /etc/crontab.

    Dean
    Dean DeBruin Guest

  13. #12

    Default Re: cron v anacron

    Dean DeBruin schrieb:
    > Torsten Flammiger wrote:
    >
    >> Dean DeBruin schrieb:
    >>
    >>> Toby Newman wrote:
    >>
    >>
    >>
    >> [...]
    >>
    >>
    >>> My /etc/crontab has the following lines:
    >>>
    >>>
    >>>> 17 * * * * root run-parts --report /etc/cron.hourly
    >>>> 25 6 * * * root test -x /usr/sbin/anacron || run-parts --report
    >>>> /etc/cron.daily
    >>>> 47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report
    >>>> /etc/cron.weekly
    >>>> 52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report
    >>>> /etc/cron.monthly
    >>>
    >>>
    >>>
    >>> As far as I can figure out (by reading man pages and by testing)
    >>> run-parts runs hourly, but for the daily, weekly, and monthly lines it
    >>> will only run if /usr/sbin/anacron does NOT exist! Am I missing
    >>> something?
    >>>
    >>> /usr/sbin/anacron DOES exist so I removed "test -x /usr/sbin/anacron ||"
    >>> from the daily, weekly, and monthly lines and now it seems to work.
    >>
    >>
    >>
    >> -x means:
    >> check for the existence AND check wether it is executable
    >>
    >> so, if /usr/sbin/anacron exists and is executable it will be executed
    >> otherwise run-parts --report will be executed.
    >>
    >> Torsten
    >
    >
    > As far as I can tell, "test -x file"only checks the existence of the
    > file and whether it is executable. It does not execute the file. The
    you are right - my mistake.. beat me :-)
    Torsten Flammiger Guest

  14. #13

    Default Re: cron v anacron

    Dean DeBruin wrote:
    > Newbie here, running Ubuntu 5.10.
    >
    > I understand cron and crontab, but crontab only runs /etc/cron.hourly,
    > anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
    >
    > At what time does anacron run /etc/cron.daily?
    >
    > Why doesn't anacron show up when I do ps aux | grep anacron?
    For anyone following this thread, cron and anacron are working properly.
    See the bug report: [url]https://launchpad.net/malone/bugs/35617[/url]

    Dean DeBruin Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139