透過 cron。 find /backup/db -type f -mtime +7 |xargs rm -rf {} find /backup/db -type f -mtime +7 -exec rm -rf '{}'