from datetime import datetime
from croniter import croniter
start = datetime(2022, 2, 20)
print("now: ", start.isoformat())
it = croniter("0 0 */5 * *", start)
for x in range(0, 10):
print(it.get_next(datetime).isoformat())
Notice that 2022-03-01 is missing from the output. I think this a bug.
I tested the same expression in Debian cron. I used the following line in crontab:
0 0 */5 * * logger -t wat every five midnights days runs
And it produced the following results:
# journalctl --since "30 days ago" -t wat | grep five
Feb 21 00:00:02 debian wat[1175]: every five midnights days runs
Feb 26 00:00:01 debian wat[4556]: every five midnights days runs
Mar 01 00:00:01 debian wat[6514]: every five midnights days runs
Mar 06 00:00:02 debian wat[9894]: every five midnights days runs
I ran the following snippet:
And got the following results:
Notice that 2022-03-01 is missing from the output. I think this a bug.
I tested the same expression in Debian cron. I used the following line in crontab:
And it produced the following results: