Results 1 to 7 of 7

Thread: Cron jobs on laptops/netbooks - is anacron needed?

  1. #1

    Default Cron jobs on laptops/netbooks - is anacron needed?

    Does anyone have much experience with cron jobs on laptops or netbooks, as in does setting MAX_NOT_RUN=1 in /etc/sysconfig/cron actually work well or is it better to just use anacron?

  2. #2
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Cron jobs on laptops/netbooks - is anacron needed?

    On 2011-06-16 11:36, tk83 wrote:
    >
    > Does anyone have much experience with cron jobs on laptops or netbooks,
    > as in does setting MAX_NOT_RUN=1 in /etc/sysconfig/cron actually work
    > well or is it better to just use anacron?


    The daily/weekly/monthly jobs will eventually work. You can not say exactly
    when, but they will run.

    Cron jobs, though, might not ever run.

    There is a difference.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  3. #3

    Default Re: Cron jobs on laptops/netbooks - is anacron needed?

    So anacron is still a good idea then I guess. Does it require any configuration or can I just install the package and it works?

  4. #4
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Cron jobs on laptops/netbooks - is anacron needed?

    On 2011-06-16 13:36, tk83 wrote:
    >
    > So anacron is still a good idea then I guess


    Depends on your needs.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

  5. #5

    Default Re: Cron jobs on laptops/netbooks - is anacron needed?

    Found this discussion last week, when wondering about the same issue, but I did not find the conclusions too convincing.

    Now I have tried it myself for a week, so I can answer.

    Quote Originally Posted by tk83 View Post
    So anacron is still a good idea then I guess.
    If you just want to make sure that a job runs once a day, regardless when you turn on the machine there is no need for anacron. Just add your "job" into /etc/cron.daily/ directory

    This is not really a cron feature, but an OpenSUSE feature, if I got it correctly. Behaviour will be determined by /etc/sysconfig/cron. Default values (at least in my 11.3) are fine, no need to change anything.

    Code:
    ## Type:         string
    ## Default:      ""
    #
    # At which time cron.daily should start. Default is 15 minutes after booting
    # the system. Example setting would be "14:00".
    # Due to the fact that cron script runs only every 15 minutes,
    # it will only run on xx:00, xx:15, xx:30, xx:45, not at the accurate time
    # you set.
    DAILY_TIME=""
    So the "jobs" from the /etc/cron.daily directory (they are not really cron jobs) run at the full quarter that follows 15 minutes after booting.

    Code:
    ## Type:         integer
    ## Default:      5
    #
    # Maximum days not running when using a fixed time set in DAILY_TIME.
    # 0 to skip this. This is for users who will power off their system.
    #
    # There is a fixed max. of 14 days set,  if you want to override this
    # change MAX_NOT_RUN_FORCE in /usr/lib/cron/run-crons
    MAX_NOT_RUN="5"
    This parameter is not relevant if DAILY_TIME has not been specified.

    Jobs would probably not be run reliably if your machine always runs for less than 30 minutes a day. Not a problem for me.

    I only need daily jobs at the moment, so I haven't thought about other frequencies would work.
    Last edited by geuder; 10-Jul-2011 at 07:09. Reason: typo

  6. #6

    Default Re: Cron jobs on laptops/netbooks - is anacron needed?

    Quote Originally Posted by geuder View Post
    Behaviour will be determined by /etc/sysconfig/cron. Default values (at least in my 11.3) are fine, no need to change anything.
    Actually when you want to see how it works, you can change one parameter:

    Code:
    ## Type:        yesno
    ## Default:     no
    #
    # generate syslog message for all scripts in 
    # cron.{hourly,daily,weekly,monthly} 
    # even if they haven't returned an error? (yes/no)
    #
    SYSLOG_ON_NO_ERROR="yes"
    (Days) Later you can do a
    Code:
    sudo grep cron /var/log/messages
    to see when your "jobs" where executed.

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Cron jobs on laptops/netbooks - is anacron needed?

    On 2011-07-10 16:36, geuder wrote:
    > Now I have tried it myself for a week, so I can answer.


    Yes, that is how it works :-)

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4 x86_64 "Celadon" at Telcontar)

Posting Permissions

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