I've yet to be shown by someone on the internet there isn't a built-in *nix tool for everything.
Sometimes I am astonished what has been sitting in my directories all these years.
The biggest one probably being the 15 minutes it took to learn how to write systemd service files, versus using <language-specific-process-monitor-and-daemon>.
This is incredible. While there is still a decent rate of false-positives or errors, it's such a nicer user interface than the powerful yet hard-to-read cron syntax.
It works, but it's a bit of a hack (to put it mildly ;-) )
Consider this expression:
0 0 1-7 * FRI
This one will run on dates 1-7, and additionally on every Friday. This is almost what we want, except we want an "AND" relationship between the day-of-month and the day-of-week fields, instead of the "OR" relationship.
The weird extra */50 bit exploits a quirk in Debian cron's expression parsing logic. It fools cron into thinking the day-of-month field is a wildcard field, and into applying the "AND" logic.
Are you sure? The man page for Vixie cron at least doesn't imply that and it's not what I remember, and the web page this links to also doesn't think that's true. So "First Friday of the month at midnight" gives "0 0 1-7 * 5".
Note: The day of a command's execution can be specified by two fields — day of month, and day of week. If both fields are restricted (i.e., aren't ), the command will be run when either field matches the current time. For example, ``30 4 1,15 5'' would cause a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.
Hey, awesome work! What are the steps I need to take to build something similar, let's say to generate awk or sed processors/filters using plain english?
I feel like AI is a poor fit for this domain, because the whole point of using a tool like this would be to check/ensure correctness. Perhaps it should at least also offer a precise translation back the other way?
Scheduled tasks are hard enough to debug as it is. The last thing I want to do is add more indeterminism!
But isn't translating from English (or some other natural language) is what a programmer does when constructing a regular expression or a cron job? So it is possible, although humans make mistakes, too. Maybe fewer, or different mistakes than "AI", but still, fundamentally it's the same.
Maybe an alternative to natural language processing could be pattern recognition from a number of user supplied examples, and its expression in an unambiguous domain language. That's also what programmers do.
> But isn't translating from English (or some other natural language) is what a programmer does when constructing a regular expression or a cron job?
No, I wouldn't say so. Even if the programmer is given the schedule from someone else (in English), they have additional context and can ask clarifying questions that this AI doesn't have.
That's my point. Without additional context, humans would make the same mistakes. Having all information that humans have, this AI could perform at human level.
One of the hardest aspects of software development is communicating with the customer, for humans and AI alike. But a translation from layman English to machine code has to happen, at some point.
You are describing it as if the developer writing the regex/cron has no prior involvement with the app, project, or company and is brought on to transcribe a specification from English to code and nothing else. In that situation an AI-driven translator app makes a lot of sense, but that doesn't match reality.
The software developer has a lot of context with the app and project that cannot be easily passed into the translator (whether AI or human). Going from that state of knowledge to the code by an intermediate, compressed, lossy, ambiguous step of natural language is necessarily inefficient. Whether that translator is operating at human level or not is not the point, going through English is the problem.
Really cool project, but I may have found a mistake. Typing "21st night september" returns “At 12:00 AM, on day 21 of the month, only in September”. And I would expect it to be maybe 9-11:59pm, not midnight that morning. But maybe 'night' is just not very well defined?
Often people want to treat the law as if it were computer code, but fortunately sometimes it's more like the grade-school teacher making sure that the kids play nicely together.
For prior art (not GPT-3 based) in debian/ubuntu based distributions:
I use to use it like: Also prior to crontab.guru: 21 years ago, more people did prefer english to cron :)