Skip to content

Commit

Permalink
Extend support frequencies: yearly_MONTH
Browse files Browse the repository at this point in the history
- Add support for yearly_MONTH
- Add support for yearly_MON (short name)
- Add cron.d entries for new frequencies

The MONTH YEAR display format is used for
email subject lines.

refs #39
  • Loading branch information
deoren committed Jun 14, 2019
1 parent 1817b11 commit 18d64ab
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
26 changes: 25 additions & 1 deletion automated_tickets_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,31 @@
'monthly':MONTH_YEAR,
'twice_year':MONTH_YEAR,
'quarterly':MONTH_YEAR,
'yearly':YEAR
'yearly':YEAR,
'yearly_january':MONTH_YEAR,
'yearly_february':MONTH_YEAR,
'yearly_march':MONTH_YEAR,
'yearly_april':MONTH_YEAR,
'yearly_may':MONTH_YEAR,
'yearly_june':MONTH_YEAR,
'yearly_july':MONTH_YEAR,
'yearly_august':MONTH_YEAR,
'yearly_september':MONTH_YEAR,
'yearly_october':MONTH_YEAR,
'yearly_november':MONTH_YEAR,
'yearly_december':MONTH_YEAR,
'yearly_jan':MONTH_YEAR,
'yearly_feb':MONTH_YEAR,
'yearly_mar':MONTH_YEAR,
'yearly_apr':MONTH_YEAR,
'yearly_may':MONTH_YEAR,
'yearly_jun':MONTH_YEAR,
'yearly_jul':MONTH_YEAR,
'yearly_aug':MONTH_YEAR,
'yearly_sep':MONTH_YEAR,
'yearly_oct':MONTH_YEAR,
'yearly_nov':MONTH_YEAR,
'yearly_dec':MONTH_YEAR,
}


Expand Down
28 changes: 28 additions & 0 deletions cron.d/automated_tickets
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,37 @@
47 5 1 3,6,9,12 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "quarterly"


# minute hour dom month dow user command
# ------------------------------------------------------------------------------------------

# Run yearly on January 1st
47 5 1 1 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly"

# Run yearly on the first of the specified month
47 5 1 1 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_january"
47 5 1 1 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_jan"
47 5 1 2 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_february"
47 5 1 2 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_feb"
47 5 1 3 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_march"
47 5 1 3 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_mar"
47 5 1 4 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_april"
47 5 1 4 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_apr"
47 5 1 5 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_may"
47 5 1 6 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_june"
47 5 1 6 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_jun"
47 5 1 7 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_july"
47 5 1 7 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_jul"
47 5 1 8 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_august"
47 5 1 8 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_aug"
47 5 1 9 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_september"
47 5 1 9 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_sep"
47 5 1 10 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_october"
47 5 1 10 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_oct"
47 5 1 11 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_november"
47 5 1 11 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_nov"
47 5 1 12 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_december"
47 5 1 12 * scripts /opt/automated_tickets/automated_tickets.py --event_schedule "yearly_dec"



# Example of job definition:
Expand Down

0 comments on commit 18d64ab

Please sign in to comment.