Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with too many files generated under linux / var/spool/clientmqueue

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you the "linux / var/spool/clientmqueue generated too many files how to deal with", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "linux / var/spool/clientmqueue generated too many files under how to deal with" this article.

Problem phenomenon:

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

Reason analysis: some users in the system open cron, and the program executed in cron has output content, which will be sent to cron users in the form of e-mail, while sendmail does not start so these files are generated; so these files are not important files, you can delete them directly!

Solution:

1. Add > / dev/null 2 > & 1 to the commands in crontab

2. Knowledge points:

2 >: redirect error.

2 > & 1: redirect the error to the place where the output is to be sent. That is, redirect the execution result of the above command to / dev/null, that is, discard, at the same time, discard the resulting errors.

3. Specific code:

(1) # crontab-u cvsroot-l

01 01 * / opt/bak/backup

01 02 * / opt/bak/backup2

(2), # vi / opt/bak/backup

#! / bin/sh

Cd /

Getfacl-R repository > / opt/bak/backup.acl

(3), # vi / opt/bak/backup2

#! / bin/sh

Week= `date +% w`

Tar zcvfp / opt/bak/cvs$week/cvs.tar.gz / repository > / dev/null 2 > & 1

4. Clear the files in the / var/spool/clientmqueue/ directory:

# cd / var/spool/clientmqueue

# rm-rf * (display parameter list is too long (- bash: / bin/rm: Argument list too long) cannot be deleted directly with rm)

If you have too many files and delete them slowly with rm, you can enter / var/spool/clientmqueue/ as root and execute the following command:

# cd / var/spool/clientmqueue

# ls | xargs rm-f

After entering the car, after two or three minutes, the execution was finally finished, and the clientmqueue was empty.

5. Pay attention to the error discarding after script output in crontab:

[oracle@linux-125 ~] $crontab-l

0 5 * / data/orabak/some.sh > / dev/null 2 > & 1

0 1 * / data/orabak/expor.sh > / dev/null 2 > & 1

The above is all the contents of the article "how to deal with too many files generated in linux / var/spool/clientmqueue". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report