From 18d64abba09b51703c19dd3a7d2b6c0b21960537 Mon Sep 17 00:00:00 2001 From: deoren Date: Fri, 14 Jun 2019 12:12:33 -0500 Subject: [PATCH] Extend support frequencies: yearly_MONTH - 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 --- automated_tickets_lib.py | 26 +++++++++++++++++++++++++- cron.d/automated_tickets | 28 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/automated_tickets_lib.py b/automated_tickets_lib.py index fb8ca7b..27871d7 100644 --- a/automated_tickets_lib.py +++ b/automated_tickets_lib.py @@ -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, } diff --git a/cron.d/automated_tickets b/cron.d/automated_tickets index 0aafd50..f5ad874 100644 --- a/cron.d/automated_tickets +++ b/cron.d/automated_tickets @@ -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: