Class Symbiosis::CrontabRecord
In: cron/lib/symbiosis/crontab.rb
Parent: Object
Array Utmp EventMachine::Connection ApacheLogger StandardError CrontabFormatError Enumerable IPAddr ::IPAddr Host Range Domain ConfigFile Prosody Tinydns Apache Webalizer Directory IPListDirectory TemplateDirectory Domains Alert Crontab CrontabRecord StateDB Check Runner TCPConnection Test Process BlacklistDB Template Logtail Pattern Ports Blacklist Monitor ConfigFiles Utils Firewall Symbiosis dot/f_0.png

This class represents and individual line of a crontab

Methods

command=   new   next_due   parse   ready?   run  

Constants

WDAY = %w(sun mon tue wed thu fri sat)   Weekday names that can be used in records
MON = %w(jan feb mar apr may jun jul aug sep oct nov dec)   Month names that can be used in records.
SHORTCUTS = { "(?:year|annual)ly" => "0 0 1 1 *", "monthly" => "0 0 1 * *", "weekly" => "0 0 * * 0", "(?:daily|midnight)" => "0 0 * * *", "hourly" => "0 * * * *"   Hash of names that correspond to @ shortcuts.

Attributes

command  [R] 
hour  [R] 
mday  [R] 
min  [R] 
mon  [R] 
wday  [R] 

Public Class methods

Create a new CrontabRecord, setting the minute, hour, month-day, month, week-day and command. Raises a CrontabFormatError if any of the arguments fail to parse.

Create a new CrontabRecord using a string. Raises CrontabFormatError if the string parsing fails.

Public Instance methods

Set the command to c. Accepts a String or Proc.

Determines when the record is next due to be run. Returns a DateTime if the time could be determined, or nil if the record is not due to run any time in the 30 years after now.

Returns true if the record should be run at time set by now.

Run the command. Returns an arry of strings as output.

[Validate]