mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
bug 7141: cleanup cloudstack logs older than 7 days
This commit is contained in:
parent
322a8f8126
commit
17451e1dae
11
patches/systemvm/debian/config/etc/cron.daily/cloud-cleanup
Executable file
11
patches/systemvm/debian/config/etc/cron.daily/cloud-cleanup
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# /etc/cron.daily/cloud-cleanup: cleanup old cloudstack logs
|
||||
|
||||
cd /
|
||||
output=$(find /var/log/cloud -mtime +7 -size +1M -exec rm -v '{}' \; )
|
||||
logger -t cloud "cloud-cleanup cronjob: cleaning up logfiles in /var/log/cloud older than 7 days and more than 1M in size"
|
||||
|
||||
[ "$output" != "" ] && logger -t cloud $output
|
||||
[ -z "$output" ] && logger -t cloud "No files removed"
|
||||
|
||||
exit 0
|
||||
Loading…
x
Reference in New Issue
Block a user