# How to schedule jobs with Quartz on Ktor

DevFeed: [How to schedule jobs with Quartz on Ktor](<https://devfeed.tech/articles/how-to-schedule-jobs-with-quartz-on-ktor-25567.md>)

Original publisher: [Read original article](<https://www.marcogomiero.com/posts/2022/ktor-jobs-quartz/>)

Author: Marco Gomiero

Published: 2022-04-22T00:00:00Z

Content type: tutorial

Language: en

Sources: [Posts on Marco Gomiero](<https://devfeed.tech/sources/posts-on-marco-gomiero.md>)

Topics: [Ktor](<https://devfeed.tech/topics/ktor.md>), [Quartz](<https://devfeed.tech/topics/quartz.md>), [Back end](<https://devfeed.tech/topics/backend.md>), [Database](<https://devfeed.tech/topics/database.md>), [Persistence](<https://devfeed.tech/topics/persistence.md>), [MySQL](<https://devfeed.tech/topics/mysql.md>)

Tags: [backend](<https://devfeed.tech/tags/backend.md>), [database](<https://devfeed.tech/tags/database.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ktor](<https://devfeed.tech/tags/ktor.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [persistence](<https://devfeed.tech/tags/persistence.md>), [quartz](<https://devfeed.tech/tags/quartz.md>), [scheduler](<https://devfeed.tech/tags/scheduler.md>), [scheduling](<https://devfeed.tech/tags/scheduling.md>)

## AI overview

This tutorial explains how to schedule recurring jobs in a Ktor backend project using Quartz. It covers Quartz's persistence of job state, database table setup, logging configuration, and scheduler creation, with MySQL used in the example.

## Source excerpt

SERIES: Building a backend with Ktor Part 1: Structuring a Ktor project Part 2: How to persist Ktor logs Part 3: How to use an in-memory database for testing on Ktor Part 4: How to handle database migrations with Liquibase on Ktor Part 5: Generate API documentation from Swagger on Ktor Part 6: How to schedule jobs with Quartz on Ktor Part 7: Moving from mobile to backend development with Ktor Sometimes, on a backend project, there is the need to run one or more tasks periodically, like for system administration, maintenance, backup, syncing content in the background, etc. These types of tasks can be scheduled "manually" with a cron job or with a scheduling library like Quartz, that makes easy for example the persistence of the task's state even after a reboot of the server.