#!/bin/sh delete_reports() { dir=$1 max_age=$2 find ${dir} -type f -mtime +${max_age} -exec /bin/rm {} \; } delete_reports /var/vmail/domain.tld/mailadmin/.cron/cur/ 30 delete_reports /var/vmail/domain.tld/mailadmin/.cron/new/ 30 delete_reports /var/vmail/domain.tld/mailadmin/.reports/cur/ 30 delete_reports /var/vmail/domain.tld/mailadmin/.reports/new/ 30 delete_reports /var/vmail/domain.tld/mailadmin/.notifications.ports/cur/ 30 delete_reports /var/vmail/domain.tld/mailadmin/.notifications.ports/new/ 30