bug 7141: cleanup cloudstack logs older than 7 days

This commit is contained in:
Chiradeep Vittal 2011-01-13 11:08:37 -08:00
parent 322a8f8126
commit 17451e1dae

View 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