Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2134203

Summary: [RFE] Modify cron syntax to allow scheduling jobs on the nth weekday of each month
Product: Red Hat Enterprise Linux 8 Reporter: Jessica Richards <jrichards2>
Component: cronieAssignee: Jan Staněk <jstanek>
Status: CLOSED MIGRATED QA Contact: RHEL CS Apps Subsystem QE <rhel-cs-apps-subsystem-qe>
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.0CC: opohorel
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-20 12:46:30 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jessica Richards 2022-10-12 18:37:58 UTC
1. Proposed title of this feature request

[RFE] Modify cron syntax to allow scheduling jobs on the nth weekday of each month

2. Who is the customer behind the request?

     Account: red hat (acct #540155)

     TAM customer: no

     CSM customer: no

     Strategic: no

3. What is the nature and description of the request?

Customers occasionally need to schedule jobs on the nth day of the month, but currently customers must use a comparatively complex workaround that looks like this:

0 3 * * mon [ $(date +%d) -le 07 ] && /path/to/script.sh


4. Why does the customer need this? (List the business requirements here)

The complexity and reduced legibility of the standard workaround makes such entries more difficult to write, read and support.

5. How would the customer like to achieve this? (List the functional requirements here)

I would like to slightly change the syntax so that this line:

0 3 * * mon/1 /path/to/script.sh

Would execute the command /path/to/script.sh on (for example) the first monday of each month.

This change is very small, but the syntax is simple and it resembles the slash syntax used for the other cron columns.

6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.

- create a cron that would run on the nth weekday each month (choosing the current day), and also a time in the near future, and wait for it to fire
- create a cron that would run on the nth weekday each month (choosing the next day), but without choosing a specific time, and wait for it to fire

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?

no

8. Does the customer have any specific time-line dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?

no

9. Is the sales team involved in this request and do they have any additional input?

no

10. List any affected packages or components.

cronie
crontabs
tfm-rubygem-parse-cron

11. Would the customer be able to assist in testing this functionality if implemented?

yes

Comment 2 RHEL Program Management 2023-09-20 12:41:28 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 3 RHEL Program Management 2023-09-20 12:46:30 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.