# Scheduling Database Jobs

**URL:** <https://community.exasol.com/t/scheduling-database-jobs/167>\
**Category:** Help Needed\
**Created:** [June 6, 2025, 3:23pm UTC](https://community.exasol.com/t/scheduling-database-jobs/167 "2025-06-06T15:23:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Exa101](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@Exa101](https://community.exasol.com/u/Exa101)\
**Post date:** [June 6, 2025, 3:23pm UTC](https://community.exasol.com/t/scheduling-database-jobs/167/1 "2025-06-06T15:23:00Z")

</div>

Hello,  
I want to run a query or job regularly, without having to do this manually. How can I schedule these to run automatically?

---

<div class="post-metadata">

**Author:** ![Vitalii\_Shilin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.exasol.com/vitalii_shilin/32/35_2.png) [@Vitalii\_Shilin](https://community.exasol.com/u/Vitalii_Shilin)\
**Post date:** [June 6, 2025, 5:48pm UTC](https://community.exasol.com/t/scheduling-database-jobs/167/2 "2025-06-06T17:48:32Z")

</div>

Exasol does not offer an in-database scheduler. There is a variety of 3rd party tools that you can use to schedule jobs to run in the database, as long as the software is able to connect directly to Exasol or can run an external command like Exaplus.

One method is to install Exaplus CLI on a Linux environment, and set up a Cron Job which opens up Exaplus. You can find more information about Cron Jobs [here](https://ostechnix.com/a-beginners-guide-to-cron-jobs/). The cronjob will run every x minutes or hours, and will connect to the database via Exaplus. Within the Exaplus command, you can specify either a query to run, or a file containing multiple SQL Files.

You can specify your credentials directly in the command, but we recommend to use an [Exaplus Profile](https://docs.exasol.com/connect_exasol/sql_clients/exaplus_cli/exaplus_cli.htm) so that you only enter this information once and it is not visible to other users:

```auto
/usr/local/bin/exaplus -u sys -p exasol -c <ip_address>:8563 -wp my_db_profile

```

For example, the command below will insert the current\_timestamp every minute into a table:

```auto
*/1 * * * * /usr/local/bin/exaplus -profile my_db_profile -sql "INSERT INTO TEST.TIMES SELECT CURRENT_TIMESTAMP;" 

```

If you have multiple commands, you can either create a Lua Script that contains all of your statements, or you can create a new file containing all of the commands. For example, I can create a file (my\_sql.sql) that contains these commands:

```auto
SELECT CURRENT_SESSION; SELECT CURRENT_TIMESTAMP; INSERT INTO TEST.TIMES SELECT CURRENT_TIMESTAMP;

```

Now I can set up the cron job to use this file instead of a single command:

```auto
*/1 * * * * /usr/local/bin/exaplus -profile my_db_profile -f /home/my_sql.sql 

```
