- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Let's just be thankful crontabs don't contain a day of year field.
Admin
Perhaps the perpetrator wrote a tool to autogenerate it? Okay I admit it, I'm reaching here ...
Admin
I just use https://crontab.guru for an interactive generator
Admin
Maybe the author works at Twitter.
Admin
I think it would take longer to write an autogenerate tool to write that crap than it would to write a sane version.
Admin
man 5 crontab
Admin
There's an obvious typo on line 14186 - "k=28" should surely read "k=29"
Admin
Never stopped anyone before.
Admin
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.
Admin
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.
Admin
If I got paid by the pound, I'd write it exactly like that.
Admin
I would just put a comment line at the top of the crontab that labels each column.
Admin
The real WTF is the Monday - Sunday check. It should be,
Admin
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)
#
Admin
Let's just hope they don't work for crontab.guru :)
Admin
OMG. "Monstrosity" is the right word. If I had to fix something in this code, I would just rewrite it from scratch.
Admin
"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?
Admin
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...