Results 1 to 9 of 9

Thread: Cronjob not longer working in SUSE 11.0

  1. #1
    andi303 NNTP User

    Default Cronjob not longer working in SUSE 11.0


    Hi all,

    are there any changes in cron behaviour on SUSE 11.0?
    I've created a cronjob-file for a daily update process under
    /etc/cron.d

    Code:
    --------------------
    30 20 * * * root zypper up -y -t patch --skip-interactive
    --------------------


    Well, the cronjob doesn't run on SUSE 11.0 (worked fine since SUSE 9).
    Are there any changes?

    Thanks in advance,
    Andreas


    --
    andi303
    ------------------------------------------------------------------------
    andi303's Profile: http://forums.opensuse.org/member.php?userid=20003
    View this thread: http://forums.opensuse.org/showthread.php?t=407585


  2. #2
    KJ44 NNTP User

    Default Re: Cronjob not longer working in SUSE 11.0


    Check cron is really running - just in case.


    --
    KJ44
    ------------------------------------------------------------------------
    KJ44's Profile: http://forums.opensuse.org/member.php?userid=1281
    View this thread: http://forums.opensuse.org/showthread.php?t=407585


  3. #3
    smpoole7 NNTP User

    Default Re: Cronjob not longer working in SUSE 11.0


    I had a similar problem a few months ago. I did a Web search and recall
    seeing some posts complaining that /etc/cron.d didn't work like it used
    to.

    I solved my problem by moving my cron job into a crontab in
    /var/spool/cron/tabs. Simply create a file with the appropriate username
    (in your case, root) and put the job in there. Remove the "root"
    username spec from the job (it's implied by the name of the file when
    you run from a spool/tab).

    Swerdna has an excellent how-to on using the crontabs. You can see the
    minor differences by following his advice.

    'HowTo: Cron Tables (Crontab) to Schedule Events in Suse Linux
    (openSUSE) 10.x, 11.x' (http://www.swerdna.net.au/linhowtocron.html)

    If that doesn't work, then as the previous poster suggested, ensure the
    cron itself is running: execute "server cron status" as root in a
    terminal, or use Yast -> System -> Services (Runlevels).


    --
    smpoole7
    ------------------------------------------------------------------------
    smpoole7's Profile: http://forums.opensuse.org/member.php?userid=13513
    View this thread: http://forums.opensuse.org/showthread.php?t=407585


  4. #4
    ken yap NNTP User

    Default Re: Cronjob not longer working in SUSE 11.0


    Hmm, /etc/cron.d has worked fine for me under 11.0 and now 11.1.

    If you look in /var/log/messages, there should be a line at the time it
    tries to execute the job.


    --
    ken_yap
    ------------------------------------------------------------------------
    ken_yap's Profile: http://forums.opensuse.org/member.php?userid=221
    View this thread: http://forums.opensuse.org/showthread.php?t=407585


  5. #5
    andi303 NNTP User

    Default Re: Cronjob not longer working in SUSE 11.0


    Thanks for all your answers!

    Well, the cron deamon is running fine, but /var/log/message/doesn't
    list the update job.
    I'm using the /etc/crontab file for custom time/user configurations for
    some of the jobs. All these entries are executed normally. I've included
    the update command in this file, we'll see the results tomorrow...

    I wonder why are there so many possibilities to run cronjobs:
    1. files in cron.daily, cron.hourly, ...
    2. files in cron.d
    3. crontab -e
    4. /etc/crontab

    The only interesting difference is the one-file-per-user scenario with
    crontab -e

    Seems to me a bit confusing...


    --
    andi303
    ------------------------------------------------------------------------
    andi303's Profile: http://forums.opensuse.org/member.php?userid=20003
    View this thread: http://forums.opensuse.org/showthread.php?t=407585


  6. #6
    ken yap NNTP User

    Default Re: Cronjob not longer working in SUSE 11.0


    In the beginning there were two locations, per user using crontab -e and
    the system crontab /etc/crontab.

    /etc/cron.d is a logical extension of /etc/crontab. It allows packages
    to easily put and remove custom crontabs there without having to disturb
    the master crontab. It's also a good place to put app specific crontabs,
    you can group a bunch of actions which might be run by different
    accounts, for say moodle.

    /etc/cron.{hourly,daily,weekly,monthly} are actually caused from that
    initial entry in /etc/crontab which says /usr/lib/cron/run-crons


    --
    ken_yap
    ------------------------------------------------------------------------
    ken_yap's Profile: http://forums.opensuse.org/member.php?userid=221
    View this thread: http://forums.opensuse.org/showthread.php?t=407585


  7. #7
    smpoole7 NNTP User

    Default Re: Cronjob not longer working in SUSE 11.0


    ken_yap;1943238 Wrote:
    > Hmm, /etc/cron.d has worked fine for me under 11.0 and now 11.1.
    >
    > If you look in /var/log/messages, there should be a line at the time it
    > tries to execute the job.


    I know. It SHOULD work. But like andi303, it wouldn't work in my case.
    Don't know why and I can't explain it.

    But the fix is simple: just move it to a per-user crontab file in
    /var/spool, and it seems to work. Go figure.


    --
    smpoole7
    ------------------------------------------------------------------------
    smpoole7's Profile: http://forums.opensuse.org/member.php?userid=13513
    View this thread: http://forums.opensuse.org/showthread.php?t=407585


  8. #8
    ken yap NNTP User

    Default Re: Cronjob not longer working in SUSE 11.0


    Did you remember that crontabs in /etc/cron.d require the account name
    in the 6th field?


    --
    ken_yap
    ------------------------------------------------------------------------
    ken_yap's Profile: http://forums.opensuse.org/member.php?userid=221
    View this thread: http://forums.opensuse.org/showthread.php?t=407585


  9. #9
    smpoole7 NNTP User

    Default Re: Cronjob not longer working in SUSE 11.0


    ken_yap;1943618 Wrote:
    > Did you remember that crontabs in /etc/cron.d require the account name
    > in the 6th field?


    Yep, and if you look at andi303's post, it's done that way. I tried it
    that way, too.

    Maybe it just hated me.


    --
    smpoole7
    ------------------------------------------------------------------------
    smpoole7's Profile: http://forums.opensuse.org/member.php?userid=13513
    View this thread: http://forums.opensuse.org/showthread.php?t=407585


Posting Permissions

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