Automating tasks with the Administrative Task Scheduler (ATS) for the Db2 service
You can use the Db2 Administrative Task Scheduler (ATS) command-line interface to rotate SSL certificates and manage diagnostic log files.
Available tasks
You can manage the following tasks using the ATS command-line interface:
| Task | Parameter | Description |
|---|---|---|
| Clean up log files | DIAGPATH_CLEANUP | Cleans up log files in the log file directory DIAGPATH, by archiving
FODC and dump.bin files and folders that are older than two weeks,
and deleting the archives that are older than two weeks. This task is scheduled by default. |
Before you begin
Set up the properties for each task in the appropriate ConfigMap. If you want to change the
default values, run the oc edit cm db2u-ats -n cpd-operators command to edit the
ConfigMap.
The ConfigMap will have the following structure:
SCHEDULE <cron schedule>
PROCEDURE_SCHEMA <task schedule> -- default 'DB2INST1'
PROCEDURE_NAME <task stored procedure name>
REMARKS <short description of the task> -- optional
You can edit parameters of the task
by editing its ConfigMap.Manage tasks
- Add or schedule a task
- To add or schedule a
task:
db2_ats task add --name <TASK_NAME> --dbname <DB_NAME> - Remove a scheduled task
- To remove a
task:
db2_ats task remove --name <TASK_NAME> --dbname <DB_NAME>
- Update a task
- To update a
task:
db2_ats task update --name <TASK_NAME> --dbname <DB_NAME> - List tasks
- To list the currently scheduled tasks:
To list a specific task:db2_ats task list --dbname=<DB_NAME>db2_ats task list --name=<TASK_NAME> --dbname=<DB_NAME>