简体   繁体   中英

Django Celery. How do I run task at exact time?

How can I write a code that will run a task for example "everyday (or every 24 hours)at 3:20 am"? The main problem is "3:20" part, how do I make cron task at this exact time?

You simply specify the minute and hour that you want it to occur on, and use * for the other values. For example: 20 3 * * * will run at 3:20 AM every day forever.

You can experiment with cron-schedules using this website to get a better understanding for how the syntax works: https://crontab.guru/#20_3_*_*_ *

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM