ExtMail used by company mail backs up user emails on the server.
The first method is to use rsync for backup.
1. Update files in the regular synchronization directory and perform Incremental Backup
2. Maintain the file owner, time
However, there is a problem when preparing rsync. The email/home directory has several hundred GB in size, so that rsync will be slow during the first synchronization.
Therefore, sort the mail size of all users and retrieve the top 10 largest users.
[Root @ mail cur] # du-s/home/domains/hwatop.com/* | sort-rn | head2915088/home/domains/hwatop.com/hr2144564/home/domains/logs/home/domains /logs/home/domains/hwatop.com/yf00001501060/home/domains/hwatop.com/wdwang
Use the find command to delete emails sent to these 10 users 30 days ago.
[Root @ mail cur] # cd/home/domains/hwatop.com/hr/maildir/cur/?root@mail cur] # find-ctime + 30 | xargs-rm
This article from the "Liu yalei" blog, please be sure to keep this source http://liuyalei.blog.51cto.com/7767729/1303496