Need to know command to delete more than 3 million files from /var/spool/clientmqueue


 
Thread Tools Search this Thread
Operating Systems Solaris Need to know command to delete more than 3 million files from /var/spool/clientmqueue
# 1  
Old 01-25-2011
Need to know command to delete more than 3 million files from /var/spool/clientmqueue

Hi

I need to delete more than 3 million files from /var/spool/clientmqueue. When I give the following command to delete the files, I get the error

Code:
# pwd
/var/spool/clientmqueue
# rm -f *
/usr/bin/rm: arg list too long

Please tell me how can I delete the files

Last edited by pludi; 01-25-2011 at 10:51 AM..
# 2  
Old 01-25-2011
Presumably you are not starting "sendmail" but have applications (or cron jobs) which cause mail.
There is a discussion about this directory, why it can get high numbers of files, and how to clean it in this link.
Huge disk usage on /var/spool/clientmqueue - comp.unix.solaris | Google Groups
Check that the circumstances match yours before deleting all files.
# 3  
Old 01-25-2011
You could try:

Code:
# cd /var/spool
# find clientmqueue -exec rm {} \;

Use this ONLY if you want to delete ALL messages in the queue.

HTH
# 4  
Old 01-25-2011
Quote:
Originally Posted by bluescreen
Code:
# find clientmqueue -exec rm {} \;

Use this ONLY if you want to delete ALL messages in the queue.
This would be quite slow with 3 million files. A slight change ('+' vs '\;') will highly improve the removal performance:
Code:
# find clientmqueue -exec rm {} +

This User Gave Thanks to jlliagre For This Post:
# 5  
Old 01-25-2011
Nice catch! Smilie
# 6  
Old 01-28-2011
My big thanks to methyl , bluescreen & jlliagre. Sorry for relying you late as I wasn't well.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

/var/spool/mail/<username> files' content wipeout impact

Hi Guys!!! ->I am using AIX 6.1. One of the file system full which is /var filesystem. ->/var total size is 5.00 GB. ->And inside the /var file system spool/mail folde is taking around 2.9 GB. ->There 3 big size of file as shown below, which shows that these files are taking more size.... (4 Replies)
Discussion started by: manjusharma128
4 Replies

2. Shell Programming and Scripting

Fast processing(mv command) of 1 million+ files using find, mv and xargs

Hi, I'd like to ask if anybody can help improve my code to move 1 million+ files from a directory to another: find /source/dir -name file* -type f | xargs -I '{}' mv {} /destination/dir I learned this line of code from this forum as well and it works fine. However, file movement is kinda... (6 Replies)
Discussion started by: agentgrecko
6 Replies

3. Solaris

Delete clientmqueue mails

My clientmqueue directory is almost 6.7GB. There are like a thousands of e-mail that are present. Is there any way to delete them or just delete them normally. Also while deleting them, do i need to shutdown my sendmail service? Root FS is almost at 100%. Please help in this. Thanks in... (1 Reply)
Discussion started by: aksijain
1 Replies

4. Solaris

/var/spool/clientmqueue

Hi, solaris : 9 can we delete the files from this location /var/spool/clientmqueue . I found around 40K files lying in this location. Regards (1 Reply)
Discussion started by: maooah
1 Replies

5. Solaris

Solaris 9, /var/spool/clientmqueue/

Hi, We have some 2-3 Solaris 9 servers with the following issue. For every cron job which has email notifications, it is sending the emails, but it create files at /var/spool/clientmqueue/ which has similar contents. " V6 T1271362260 K1271362260 N1 P30359 MDeferred: Connection refused... (1 Reply)
Discussion started by: uxadmin007
1 Replies

6. UNIX for Dummies Questions & Answers

/var/spool/mail

Hi, How can i get my mail on either /var/spool/mail or /var/mail? I use mail and sendmail command to send mail. But everytime I send mail it comes to my outlook inbox and when I check with mail command I get the message "No mail for siba". (Note siba is my user Id.) (2 Replies)
Discussion started by: siba.s.nayak
2 Replies

7. UNIX for Dummies Questions & Answers

Can I delete the file var/spool/mail/news?

The file var/spool/mail/news has grown very large and takes up too much space. Can I delete this without any problem? (3 Replies)
Discussion started by: dennisheazle
3 Replies

8. UNIX for Dummies Questions & Answers

Files still being created in /var/spool/mmdf/lock/home

Hi all I need help finding a process that is continuing to create files in the above area. There are three sub folder titled addr q.local and msg . I have already found a process called mmdf running and have used the kill command to stop this from running. I have also looked for sendmail or... (12 Replies)
Discussion started by: TeaMaker
12 Replies

9. UNIX for Dummies Questions & Answers

How safe is it to remove files(/var/spool/mail)?

How safe is it to remove these spooler mail files. I need to make some room in the /usr directory? Any ideas? thanks (2 Replies)
Discussion started by: larcom61
2 Replies

10. UNIX for Dummies Questions & Answers

/var/spool/mqueue !!!

I keep having this msg on my SunOS console : Jun 29 08:57:40 bersimis sendmail: NOQUEUE: low on space (have 0, SMTP-DAEMON needs 101 in /var/spool/mqueue) I tried to make some space by deleting the files in it, but the msg came back ... Any tips ? Thanks (3 Replies)
Discussion started by: Wingman21
3 Replies
Login or Register to Ask a Question