2017 © Pedro PelĂĄez
 

library cronlingo

Express crontabs as human readable phrases

image

ajbdev/cronlingo

Express crontabs as human readable phrases

  • Sunday, December 20, 2015
  • by ajbdev
  • Repository
  • 7 Watchers
  • 147 Stars
  • 2,594 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 4 Versions
  • 66 % Grown

The README.md

Build Status, (*1)

CRON Lingo

CronLingo turns human readable strings about time and turns them into valid crontabs., (*2)

Examples:, (*3)

echo CronLingo::fromExpression('Every day at midnight');
// "0 0 * * *"

echo CronLingo::fromExpression('Every 15 minutes at midnight on the weekend');
// "*/15 0 * * 0,6"

echo CronLingo::fromExpression('Every other minute in August at noon on a weekday');
// "*/2 12 * 8 1,2,3,4,5"

echo CronLingo::fromExpression('The 1st day in April at midnight');
// "0 0 1 4 *"

echo CronLingo::fromExpression('Every day on the weekday at 2:25pm');
// "25 14 * * 1,2,3,4,5"

Syntax

CronLingo identifies the parts of a string with specific time-related keywords such as "on, to, at" and uses this to deduce the time meaning and convert it into part of a cron tab. It's not particular about the order of these statements. Here's a brief list of things that it will pick up and parse into a crontab: - Periods (daily, weekly, monthly) - Exact times (9:30 PM, 8a, 3p) - Meridiems (AM/PM/A/P) - Intervals (1st, second, other, ninth, etc) - Specific fields (second, minute, hour, day, month) - Day of week (sunday, monday, etc) - 12 o'clocks (noon, midnight) - Lists (e.g., 5 to 12 minutes) - Month names (january, february, etc) - Weekend / weekday, (*4)

What's a cron tab?

A cron tab is an expression that defines a recurring period of time., (*5)

It looks something like this:, (*6)

*    *    *    *    *
-    -    -    -    -
|    |    |    |    |
|    |    |    |    +----- day of week (0 - 7) (Sunday=0 or 7)
|    |    |    +---------- month (1 - 12)
|    |    +--------------- day of month (1 - 31)
|    +-------------------- hour (0 - 23)
+------------------------- min (0 - 59)

From Wikipedia:, (*7)

The software utility Cron is a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its general-purpose nature makes it useful for things like connecting to the Internet and downloading email at regular intervals., (*8)

The Versions

20/12 2015

dev-invert-crontab

dev-invert-crontab

Express crontabs as human readable phrases

  Sources   Download

MIT

The Development Requires

by Andy Baird

13/12 2015

dev-master

9999999-dev

Express crontabs as human readable phrases

  Sources   Download

MIT

The Development Requires

by Andy Baird

11/12 2015

v0.1.1

0.1.1.0

Express crontabs as human readable phrases

  Sources   Download

MIT

The Development Requires

by Andy Baird

11/12 2015

v0.1

0.1.0.0

Express crontabs as human readable phrases

  Sources   Download

MIT

The Development Requires

by Andy Baird