/Var/spool/clientmqueue analysis and massive File Deletion

Source: Internet
Author: User

/Var/spool/clientmqueue analysis and massive file deletion processing many files exist in the/var/spool/clientmqueue directory of a server. The ls has to be executed for a long time and has been checked online, record: cause: some users in the system have enabled cron, while the Program executed in cron has output content, which will be sent to cron users by email, sendmail does not start, so these files are generated. Solution: Add>/dev/null 2> & 1 knowledge point 2> after the command in crontab: Redirection error. 2> & 1: redirect the error to the place where the output is to be sent. That is, the execution result of the above command is redirected to/dev/null, that is, discard, and also discard the errors. How to clear massive files: it is a little difficult to use ls directly. On the internet, ls | xargs rm-f may be used, which may lead to increased server load. The following method is recommended: 1. create an empty directory Shell code mkdir/data/blank 2. use rsync to delete the target directory: Shell code rsync -- delete-before-a-H-v -- progress -- stats/data/blank // targetdir parameter description: -delete-before: the receiver deletes the object before transmission.-progress displays the transfer process during transmission-a archive mode, indicating that the object is transmitted recursively, and keep all file properties-H keep the hard connection file-v detailed output mode-stats give the transmission status of some files-d transfer directories without recursing

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.