Extmail deletes a user's email 30 days ago

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.