1

As we already know that the pattern * */2 * * * executes the task for every 2 hour, similary can * * */2 * * execute the task for every 2 day (once in 2 days). If yes, at what time the task will be executed?

jww
  • 97,681
  • 90
  • 411
  • 885
Prem
  • 5,685
  • 15
  • 52
  • 95
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Jan 29 '18 at 14:50
  • Note that `* */2 * * *` runs the task once every minute of every 2. hour (it does not run once every 2 hours, if you wanted it to run once every 2 hours, on the hour, use `0 */2 * * *` – nos Jan 29 '18 at 14:50
  • @jww Then how https://stackoverflow.com/questions/1382634/how-to-set-cronjob-for-2-days got 28 upvotes? – Prem Jan 29 '18 at 15:13
  • 1
    @Prem - It is a common trap. That QA is from 2009. The site rules were different back then. The rules in effect now have been existed since 2012 or so. – jww Jan 29 '18 at 15:20
  • @jww Thanks for clarification. – Prem Jan 29 '18 at 15:20
  • @Prem do you mean "every second day of the month" or "every second day" – kvantour Jan 30 '18 at 13:26

1 Answers1

0

This is a duplicate of dozen of posts about this topic, of which this exhaustive one.

0 0 2 * * : every 2 days at midnight, every month.
0 0 */2 * * : 2nd of the month at midnight, every month.

hornetbzz
  • 9,188
  • 5
  • 36
  • 53
  • Don't just copy someone's else's answer. Instead, flag the question as a duplicate. – Robert Columbia Mar 18 '19 at 15:25
  • @columbia : I did not copy anything. Obviously it is a duplicate. So what, not valid enough to downgrade a correct answer and play the teacher. Not fair and no value added vs. answering appropriately to a question. – hornetbzz Mar 19 '19 at 17:42
  • It is the other way around. */2 means every two time units. – Jérôme May 12 '23 at 13:18