Results 1 to 3 of 3

Thread: Interesting cron behavior (Ubuntu Server 12.04.4)

  1. #1
    Join Date
    Jul 2008
    Beans
    185

    Interesting cron behavior (Ubuntu Server 12.04.4)

    So I have a user cron that runs this:

    * 3 * * 1-5 /opt/bin/wol

    This should fire off at 03:00 once. Instead, it fires off every minute as shown with my cron emails:
    Jan 14 03:00:01 gateway CRON[2698]: (me) CMD (/opt/bin/wol)
    Jan 14 03:01:01 gateway CRON[2941]: (me) CMD (/opt/bin/wol)
    [redacted]
    Jan 14 03:58:02 gateway CRON[7302]: (me) CMD (/opt/bin/wol)
    Jan 14 03:59:01 gateway CRON[7329]: (me) CMD (/opt/bin/wol)

    my actual /etc/crontab file:
    # m h dom mon dow user command
    1 * * * * root cd / && run-parts --report /etc/cron.hourly
    1 0 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
    1 0 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
    1 0 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
    58 23 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.reports )
    0-59/5 * * * * root /usr/local/bro/bin/broctl cron

    Anything I can do to troubleshoot this weird behavior? Thank you.

  2. #2
    Join Date
    Jul 2013
    Location
    Wisconsin
    Beans
    4,208

    Re: Interesting cron behavior (Ubuntu Server 12.04.4)

    Quote Originally Posted by DigiAngel View Post

    * 3 * * 1-5 /opt/bin/wol

    This should fire off at 03:00 once.
    It should fire off each minute during the 3 hour, since the minute field is a '*'.
    From your description, that's what it's properly doing.

    If you want it to fire off just once, specify a minute also:

    0 3 * * 1-5 /opt/bin/wol

  3. #3
    Join Date
    Jul 2008
    Beans
    185

    Re: Interesting cron behavior (Ubuntu Server 12.04.4)

    Ah darn...nice catch thanks Ian. This will most likely fix it right up Thanks again.

Bookmarks

Posting Permissions

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