Python Cron job开发

利用ApScheduler https://pypi.python.org/pypi/APScheduler/ 开发cron job

def restartHubMain(self):
		self.write(self.hostname)
		self.scheduler = Scheduler(daemonic = False)
		self.scheduler.start()
		job = self.scheduler.add_cron_job(self.restartService,day_of_week=self.day_of_week,hour=self.hour,minute=self.minute,second=self.second)


	def stopJob(self):
		self.scheduler.shutdown()

 文档: http://pythonhosted.org/APScheduler/cronschedule.html

 

你可能感兴趣的:(python)