Skip to content

Commit

Permalink
Merge branch 'master' of github.com:oravirt/ansible-oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
oravirt committed Jan 10, 2019
2 parents 6b1c461 + 0747fb1 commit 6852f16
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
9 changes: 9 additions & 0 deletions roles/orahost-logrotate/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ logrotate_config:
- rotate 3
- dateext
- compress
- name: oracle_rman
file: "{{ rman_cron_logdir | default('/var/log/oracle/rman/log') }}/*.log {{ oracle_base }}/admin/*/rman/*.log {{ oracle_base }}/admin/*/rman/log/*.log"
options:
- missingok
- notifempty
- compress
- weekly
- rotate 24
- dateext
12 changes: 7 additions & 5 deletions roles/orahost-logrotate/templates/oracle_cleanup.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
# Remove Auditfiles from Filesystem
for audit in {{oracle_base}}/admin/*/adump {{ oracle_home_gi }}/rdbms/audit
do
find ${audit} -name "*.aud" -type f -mtime {{oracle_cleanup_days}} -delete 2>/dev/null
find ${audit} -name "*.xml" -type f -mtime {{oracle_cleanup_days}} -delete 2>/dev/null
find ${audit} -name "*.aud" -type f -mtime +{{oracle_cleanup_days}} -delete 2>/dev/null
find ${audit} -name "*.xml" -type f -mtime +{{oracle_cleanup_days}} -delete 2>/dev/null
done

# Remove all xml-Files from ADR
# We ignore, that individual cleanups are existing in ADR
find {{oracle_base}}/diag/rdbms/*/*/alert -name "*.xml" -type f -mtime {{oracle_cleanup_days}} -delete 2>/dev/null
find {{oracle_base}}/diag/rdbms/*/*/alert -name "*.xml" -type f -mtime +{{oracle_cleanup_days}} -delete 2>/dev/null
find {{oracle_base}}/diag/asm/*/*/alert -name "*.xml" -type f -mtime +{{oracle_cleanup_days}} -delete 2>/dev/null

# Remove Tracefiles from ADR
# We ignore a possible policy in ADR
find {{oracle_base}}/diag/rdbms/*/*/trace -name "*.tr?" -type f -mtime {{oracle_trace_cleanup_days}} -delete 2>/dev/null
find {{oracle_base}}/diag/rdbms/*/*/trace -name "*.tr?" -type f -mtime +{{oracle_trace_cleanup_days}} -delete 2>/dev/null
find {{oracle_base}}/diag/asm/*/*/trace -name "*.tr?" -type f -mtime +{{oracle_trace_cleanup_days}} -delete 2>/dev/null

#
find {{oracle_base}}/diag/tnslsnr/*/*/alert -name "*.xml" -type f -mtime {{oracle_cleanup_days}} -delete 2>/dev/null
find {{oracle_base}}/diag/tnslsnr/*/*/alert -name "*.xml" -type f -mtime +{{oracle_cleanup_days}} -delete 2>/dev/null


0 comments on commit 6852f16

Please sign in to comment.