25 lines
659 B
SQL
25 lines
659 B
SQL
-- Optional: register ES biz-log cleanup job (keep last 3 months)
|
|
-- Invoke: esBizLogCleanupTask.cleanupOlderThanMonths(3)
|
|
-- Cron: 03:00 on the 1st of every month
|
|
|
|
INSERT INTO sys_job (
|
|
job_name, job_group, invoke_target, cron_expression,
|
|
misfire_policy, concurrent, status, create_by, create_time, remark
|
|
)
|
|
SELECT
|
|
'ES业务日志清理',
|
|
'DEFAULT',
|
|
'esBizLogCleanupTask.cleanupOlderThanMonths(3)',
|
|
'0 0 3 1 * ?',
|
|
'3',
|
|
'1',
|
|
'0',
|
|
'admin',
|
|
NOW(),
|
|
'删除 bms_biz_log 中 3 个月前的文档;ES 需在线'
|
|
FROM DUAL
|
|
WHERE NOT EXISTS (
|
|
SELECT 1 FROM sys_job
|
|
WHERE invoke_target = 'esBizLogCleanupTask.cleanupOlderThanMonths(3)'
|
|
);
|