# Cron\_module parameters help

**URL:** <https://forum.ansible.com/t/cron-module-parameters-help/4745>\
**Category:** Get Help\
**Created:** [April 5, 2024, 9:41am UTC](https://forum.ansible.com/t/cron-module-parameters-help/4745 "2024-04-05T09:41:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aleksej](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aleksej/32/2790_2.png) [@Aleksej](https://forum.ansible.com/u/Aleksej)\
**Post date:** [April 5, 2024, 9:41am UTC](https://forum.ansible.com/t/cron-module-parameters-help/4745/1 "2024-04-05T09:41:32Z")

</div>

Can both variables **weekday** and **day** be defined at the same time?  
[https://docs.ansible.com/ansible/latest/collections/ansible/builtin/cron\_module.html](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/cron_module.html)

If I set **day** equals to 2 and **weekday** equals to 2 then it would works at the 2nd day of every month and tuesday every week?

---

<div class="post-metadata">

**Author:** ![markuman](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@markuman](https://forum.ansible.com/u/markuman)\
**Post date:** [April 5, 2024, 1:57pm UTC](https://forum.ansible.com/t/cron-module-parameters-help/4745/2 "2024-04-05T13:57:04Z")

</div>

Try it and see 😉

weekday is the last position of cron (5th position).  
monthday is the third position.

`0 4 2 * 2` will execute on 2nd day of month and every tuesday.  
So yes, you can set both at the same time. If two parameters are conflicting, it is documentated in general.

---

<div class="post-metadata">

**Author:** ![Aleksej](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/aleksej/32/2790_2.png) [@Aleksej](https://forum.ansible.com/u/Aleksej)\
**Post date:** [April 5, 2024, 3:57pm UTC](https://forum.ansible.com/t/cron-module-parameters-help/4745/3 "2024-04-05T15:57:47Z")

</div>

Thank you for your respond.  
There’s no chance to try it for I can only read configs and analyze it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [May 5, 2024, 3:57pm UTC](https://forum.ansible.com/t/cron-module-parameters-help/4745/4 "2024-05-05T15:57:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
