I want to schedule a job (run a python script) everyday at a specific time till a specific date has been reached. Researching on a lot of Pythonic schedulers, I thought that APScheduler was a good candidate to get around this. This is an example snippet using APScheduler that starts a job and executes it every two hours after a specified date.
from datetime import datetime
from apscheduler.scheduler import Scheduler
# Start the scheduler
sched = Scheduler()
sched.start()
def job_function():
print "Hello World"
# Schedule job_function to be called every two hours
sched.add_interval_job(job_function, hours=2)
# The same as before, but start after a certain time point
sched.add_interval_job(job_function, hours=2, start_date='2010-10-10 09:30')
How to achieve the same and have a upper limit date after which the job should not be executed? Any suggestions that revolve within and outside the APScheduler are most welcome. Thanks in advance.