• Foo AKA Fooo (unregistered)

    Let's just be thankful crontabs don't contain a day of year field.

  • Prime Mover (unregistered)

    Perhaps the perpetrator wrote a tool to autogenerate it? Okay I admit it, I'm reaching here ...

  • huppenzuppen (unregistered)

    I absolutely cannot successfully edit a crontab file without spending a lot of time reading docs

    I just use https://crontab.guru for an interactive generator

  • (nodebb)

    Maybe the author works at Twitter.

  • Sole Purpose Of Visit (unregistered) in reply to Prime Mover

    I think it would take longer to write an autogenerate tool to write that crap than it would to write a sane version.

  • YourqLinuxManPage (unregistered)

    man 5 crontab

       The time and date fields are:
    
              field          allowed values
              -----          --------------
              minute         0-59
              hour           0-23
              day of month   1-31
              month          1-12 (or names, see below)
              day of week    0-7 (0 or 7 is Sunday, or use names)
    
  • Tim (unregistered)

    There's an obvious typo on line 14186 - "k=28" should surely read "k=29"

  • Daniel Orner (github) in reply to Sole Purpose Of Visit

    Never stopped anyone before.

  • (nodebb)

    Check out all that "proper indent" stuff! Also, I'm impressed by the "comments" that appear to show loop depth and, quite literally, nothing else.

  • Gearhead (unregistered)

    Surely hand coded. The "comments" are placed haphazardly, have an inconsistent number of forward slashes, and are not indented consistently. There is an extra blank line at lines 11553, 11698, and 11822, all after a "serie=false; k=8;" block. Lines 10840-10892 are like a work of art. Some of those blank lines have spaces, some don't.

    I'd be curious to see a screenshot of the UI. The author short-changed Januar and Februar but splurged on Jully.

    The logic for the minutes seems to be incorrect. The widgets are named in 10 minute intervals such as "chkBoxMinutes30", but the pauto_minute string is based on "k" and "ktransit" values between 0 and 6. Even if the factor of 10 had been properly included, the max value for k should have been 5.

  • Someone Else (unregistered)

    If I got paid by the pound, I'd write it exactly like that.

  • I dunno LOL ¯\(°_o)/¯ (unregistered)

    I would just put a comment line at the top of the crontab that labels each column.

  • Paid by the LoC (unregistered)

    The real WTF is the Monday - Sunday check. It should be,

            if (this.myObject.chkBoxSunday.Checked)
            {
                if (serie)
                {
                    ktransit = 6;
                    pauto_day_of_week = "*";
                }
    
  • Lazy coder (unregistered)

    I just put the following comment at the top of each of my crontabs and never need to refer to a man page:

    # * * * * * 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)
    #

  • richarson (unregistered) in reply to Rick

    Maybe the author works at Twitter.

    Let's just hope they don't work for crontab.guru :)

  • (nodebb)

    OMG. "Monstrosity" is the right word. If I had to fix something in this code, I would just rewrite it from scratch.

  • MaxiTB (unregistered)
    Comment held for moderation.
  • (nodebb)

    "The purpose of this block is to determine if we have a contiguous series of days, or run on independent days." While there are obviously sane ways to do it, is it even necessary in the first place? If you're already autogenerating your crontab does it really matter if you write "10,11,12,13" instead of "10-13"? Sure the latter looks prettier, but is cron going to choke on the former?

  • Officer Johnny Holzkopf (unregistered) in reply to Rick

    In Germany, as it seems, hinted at by the inconsistent and misspelled names of the months: Januar, Februar, March, April, May, June, Jully, August, September, October, November, December. The result: Serie...

Leave a comment on “Exhaustive Scheduling Options”

Log In or post as a guest

Replying to comment #:

« Return to Article