saving uncommitted changes in /etc prior to dnf run
This commit is contained in:
7
cron.daily/ossec_logs_cleaner
Executable file
7
cron.daily/ossec_logs_cleaner
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
# -delete option implicitly uses -depth, which traverse folders with DFS
|
||||
# (beginning with folder's content, ending with folder itself)
|
||||
# so, if old folder contains old files, "directory is not empty" error won't happen.
|
||||
# Old folder may not be deleted only if contains recently modified files
|
||||
find -H /var/ossec/logs/{alerts/*,archives/*,firewall/*} -mtime +2 -not -name alerts.json -delete >/dev/null 2>&1
|
||||
exit 0
|
||||
Reference in New Issue
Block a user