pythonpython-3.xapscheduler

How to run apscheduler daily at a specific time?


For example, I am doing this now to run a job daily.

sched.add_job(job_function, 'interval', days=1)

It runs the job daily but there is no specific time.

I want to run the at a specific time like at 11 A.M.


Solution

  • How to define an APScheduler cron job that runs every day at 11am:

    scheduler.add_job(
                id='job1',
                func=do_stuff, 
                trigger='cron',
                hour=11
            )
    

    For more info checkout APScheduler Triggers: Cron