Skip to content
Snippets Groups Projects
Commit f88dee9a authored by Jörg Sachse's avatar Jörg Sachse
Browse files

feat: add cleanup job for removing old Oracle incident/trace logs

parent e498d097
No related branches found
No related tags found
No related merge requests found
[Unit]
Description=Cleanup Daemon for Oracle Incidents
After=network.target
[Service]
ExecStartPre=/usr/bin/find /exlibris/app/oracle/diag/rdbms/dps/dps/incident/ -mtime 7 -delete
ExecStart=/usr/bin/find /exlibris/app/oracle/diag/rdbms/dps/dps/trace/ -mtime 7 -delete
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
Type=simple
### Security features
# documented at https://www.freedesktop.org/software/systemd/man/systemd.exec.html
#ProtectSystem=strict
#ProtectHome=read-only
#ProtectHostname=true
#ProtectClock=true
#ProtectKernelTunables=true
#ProtectKernelModules=true
#ProtectKernelLogs=true
#ProtectControlGroups=true
#LockPersonality=true
#MemoryDenyWriteExecute=true
#RestrictRealtime=true
#RestrictSUIDSGID=true
## RemoveIPC=true
## PrivateMounts=true
## MountFlags=
## SystemCallFilter is a Whitelist!!!
#SystemCallFilter=@aio,@basic-io,@debug,@file-system,@network-io
#SystemCallErrorNumber=1337
[Install]
WantedBy=multi-user.target
[Unit]
Description=Cleanup Daemon for Oracle Incidents
[Timer]
Unit=cleanup_oracle_incidents.service
Persistent=true
OnCalendar=daily
[Install]
WantedBy=default.target
---
- name: deploy SystemD cleanup units
ansible.builtin.copy:
src: "usr/local/lib/systemd/system/cleanup_oracle_incidents.{{ item }}"
dest: "/usr/local/lib/systemd/system/"
mode: "0644"
loop:
- "service"
- "timer"
- name: enable & start SystemD cleanup units
ansible.builtin.systemd:
name: "cleanup_oracle_incidents.{{ item.n }}"
enabled: "{{ item.e | default(true) }}"
state: "{{ item.s | default('started') }}"
daemon_reload: true
loop:
- n: "service"
s: "stopped"
- n: "timer"
......@@ -21,3 +21,6 @@
- name: configure logrotate
ansible.builtin.import_tasks: "oracle/configure_logrotate.yml"
tags: [oracle, logrotate]
- name: install cleanup jobs
ansible.builtin.import_tasks: "oracle/install_cleanup_jobs.yml"
tags: [oracle, cleanup, log, alertlog]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment