feat(cron): added atop logs cleanup cron
This commit is contained in:
@@ -13,6 +13,7 @@ monitoring_enabled: true
|
||||
# Logs
|
||||
common_journal_retention_days: 21
|
||||
common_journal_max_disk_limit: "5%"
|
||||
common_atop_retention_days: 3
|
||||
|
||||
# User management
|
||||
admin_users:
|
||||
|
||||
@@ -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"
|
||||
user: root
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user