Search code examples
pythondjangodjango-celerycelery-taskcelerybeat

Celery crontab to schedule 1 of the month and quarterly in year


I have a celery task which executes quarterly on 1 of the month how can my month_of_year can be written

{
    'task': 'mytask',
    'schedule': crontab(day_of_month='1', month_of_year='')
},

Solution

  • Use month_of_year='*/3' to run every quarter month

    {
        'task': 'mytask',
        'schedule': crontab(0, 0, day_of_month='1', month_of_year='*/3')
    },