Solution for generating a large number of files in the /var/spool/clientmqueue/ directory

There are a large number of files in the /var/spool/clientmqueue/ directory.

Reason:
     Query on baidu and find out that the reason for these massive files is: a user in the system has opened cron, and the program executed in cron has output content, and the output content will be It is sent to cron users in the form of e-mail, and sendmail is not activated, so these files are generated; so these files are not important files, delete them!     
    So cd /var/spool/clientmqueue
       rm * (rm -f *) does not work, the parameter list is too long (-bash: /bin/rm: Argument list too long
) and cannot be deleted directly with rm, what should I do?

Solution:
    Add > /dev/null 2>&1 to the command in crontab. Such as: ls -l / > /dev/null 2>&1

to add, it is very slow to delete these files with rm when there are too many files, you can enter /var/spool/clientmqueue/ as root, and execute: ls|xargs rm -f All can be removed

using xargs

# cd /var/spool/clientmqueue
# ls | xargs rm -f
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326127621&siteId=291194637