As you may have learned from the previous articles in this series, the tasks in DBeaver can significantly simplify your routine processes and save you time. But what if you want your tasks to run on specific days and times? In this case, you can use the Scheduler, another useful feature of DBeaver.
The Scheduler enables you to perform routine tasks automatically. With DBeaver, you can use the Windows Task Scheduler on Windows or Cron on macOS and GNU/Linux to set timestamps for your task execution.
Working with tasks: how to get startedDatabase Tasks View: all your tasks in one place
Composite tasks and how to create them How to use Scheduler for your tasks (now you are here)
When the Scheduler can be useful
In the last article, we told you about our hero Louis, who uses composite tasks to automate his workflows. The boss appreciated his success and asked, in addition to the weekly report on Friday, to send him reports by mail every Tuesday and Thursday. Louis wondered how he could keep this request in mind and not be distracted by it while doing other work.
For this purpose, our hero can use the Scheduler in DBeaver. To do so, he needs to open the Database Tasks View, choose his composite task, right-click on it and go to Scheduler -> Schedule task.
Using the Scheduler is only available in DBeaver Enterprise and DBeaver Ultimate.
Since Louis needs to run the same task three times a week, he selects the options he needs and clicks the Schedule button.
You can read detailed information about configuring the Scheduler for different operating systems on our Wiki
On the selected days and at the time specified by Louis, DBeaver will be launched, and the task will be executed. The task execution results will be displayed in the right column of the Database Tasks View. Using the context menu, our hero can remove the Schedule, make the necessary edits or change the settings.
In DBeaver, Louis can schedule any number of tasks to run at any interval. So after ensuring everything works correctly, he adds one more task to the Scheduler to get new data about all the purchases for the previous day. Our hero used to do this manually using an SQL script, so now all he needs to do is to create a new task to execute his script.
Then he can add a new task to the Scheduler, select the days from Monday to Friday, and set the time he usually starts his working day.
That’s it. Great job, Louis! Thanks to the Scheduler, now he has more free time for other work, and he will not forget to send the required reports to his boss. It’s so nice when someone can take care of tasks for you! Even if it is our DBeaver consisting of lines of code. Impressed by our hero’s success, you can also try to use this cool feature to perform your routine tasks on a schedule.