Cron_module parameters help

Can both variables weekday and day be defined at the same time?
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?

Try it and see :wink:

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.

1 Like

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

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