feat(cron): added atop logs cleanup cron

This commit is contained in:
ITQ
2026-05-19 09:31:57 +03:00
parent 1ccadc233d
commit 4395180ec6
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -13,6 +13,7 @@ monitoring_enabled: true
# Logs # Logs
common_journal_retention_days: 21 common_journal_retention_days: 21
common_journal_max_disk_limit: "5%" common_journal_max_disk_limit: "5%"
common_atop_retention_days: 3
# User management # User management
admin_users: admin_users:
+10
View File
@@ -8,3 +8,13 @@
job: "/usr/bin/journalctl --vacuum-time={{ common_journal_retention_days }}d --vacuum-size={{ common_journal_max_disk_limit }} > /dev/null 2>&1" job: "/usr/bin/journalctl --vacuum-time={{ common_journal_retention_days }}d --vacuum-size={{ common_journal_max_disk_limit }} > /dev/null 2>&1"
user: root user: root
state: present state: present
- name: Create cron job to prune atop with configurable limits
become: true
ansible.builtin.cron:
name: "Prune atop logs ({{ common_atop_retention_days }} days"
minute: "0"
hour: "2"
job: "/usr/bin/find /var/log/atop -name 'atop_*' -mtime +{{ common_atop_retention_days }} -delete > /dev/null 2>&1"
user: root
state: present