LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 04-26-2006, 12:17 PM   #1
HLisD1
LQ Newbie
 
Registered: Apr 2006
Posts: 4

Rep: Reputation: 0
Delete files in /var/spool/mqueue


RedHat 7.3
./spool/mqueue is 2.9 GB and the root parition is 100% full. In order to recover space until I can get to the root cause of the problem I want to delete the files in mqueue. I've stopped Sendmail and tried rm -rf * . . . which give the following error: bash:/bin/rm: Argument list too long. What steps should I take?
 
Old 04-26-2006, 12:30 PM   #2
satinet
Senior Member
 
Registered: Feb 2004
Location: England
Distribution: Slackware 11, Sabayon 3.1
Posts: 1,463

Rep: Reputation: 46
why are you using 3 dots (...)?

i would cd to the directory then type rm -rf *.

make sure you're in the correct directory though!

i.e not "/"
 
Old 04-26-2006, 01:25 PM   #3
HLisD1
LQ Newbie
 
Registered: Apr 2006
Posts: 4

Original Poster
Rep: Reputation: 0
cd var/spool/mqueue
rm -rf *

This did not work. Still giving error: bash:/bin/rm: Argument list too long message. Additionl suggestions would be appreciated.
 
Old 04-26-2006, 01:58 PM   #4
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,374
Blog Entries: 1

Rep: Reputation: 60
There are too many files on mqueue !
Go to a directory below and remove mqueue (rm -rf mqueue).
Before that, take note owner/permissions of mqueue (ls -ld mqueue) to be able to re-create it with the same permissions (chown, chmod).

Last edited by marozsas; 04-26-2006 at 02:24 PM.
 
Old 04-27-2006, 08:17 AM   #5
nishidwivedi
LQ Newbie
 
Registered: Apr 2006
Posts: 5

Rep: Reputation: 0
delete files at /var/spool/queue

try >/var/spool/mqueue

U might need to have permissions to do this.
Check if u have sudo access
 
Old 02-01-2011, 09:05 PM   #6
L1ttl3J1m
LQ Newbie
 
Registered: Feb 2011
Posts: 1

Rep: Reputation: 0
Too many files to handle that way

Although this question is an old one, this info may be handy for someone having the same issue;

The error message is happening because when the wildcard * is used with a command, Linux will go through the directory and build a list of the files it's going to delete. Since there's so many of them, it runs out of room to store the list of files.

One way around it is to use the find command with the -exec option. This will run a separate rm command for each file found by find, rather than trying to do them all at once.


find /var/spool/mqueue -type f -exec rm -f {} \;

-type f : searches for files only
-exec : do the following command. {} is where find will put the name of the find result to be acted on by the command.
rm -f : include the -f force option to stop it prompting you to remove every file

You could add other things to the find command , such as

find /var/spool/mqueue -type f -mtime +5 -exec rm -f {} \;

-mtime +5 will only delete message older than five days, so you don't need to delete the whole queue

Hope that helps someone out there.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/usr/spool and /var/spool davidsrsb Slackware 1 04-06-2006 06:57 AM
/var/spool/mqueue/ is empty, but Sendmail keeps on sending messages guarriman Linux - Software 1 02-20-2006 05:46 AM
Printing from Mozilla creates 200Mb files in /var/spool/cups mikeyt_333 Linux - Software 3 05-23-2004 01:47 PM
What is /var/spool/mqueue?? WorldBuilder Linux - General 4 05-07-2003 03:32 PM
How to Lock Files (/etc/passwd /var/spool/[user] Larry James Programming 3 12-04-2000 12:06 PM


All times are GMT -5. The time now is 01:34 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration