What's the root command to clean out exims queue?

WebHostPro

Well-Known Member
PartnerNOC
Jul 28, 2002
1,727
28
328
LA, Costa RIca
cPanel Access Level
Root Administrator
Twitter
I had it some where but I can't find it now..

It's the command to clean out the exims queue from a command prompt.

Also anyone know what this is:

2003-07-25 02:37:36 19fz0x-0004rn-B7 Cannot open main log file "/var/log/exim_mainlog": Permission denied: euid=47 egid=12
2003-07-25 02:37:37 19fz0z-0004s5-QH <= <> R=19fz0y-0004ru-8b U=mailnull P=local S=1268

I have thousands in a row on the exim_panic log.

Thanks,

cPanel.net Support Ticket Number:
 
Last edited:

Silverado

Well-Known Member
Mar 19, 2003
153
0
166
Backyard - Poolside
/usr/local/cpanel/whostmgr/bin/whostmgr2 killeximq is ok..

But if you really want to get everything out of exim...

rm -rf /var/spool/exim/msglog/ and you can use the same to clean out the input file rm -rf /var/spool/exim/input/

Beware though... this will remove everything in queue.

cPanel.net Support Ticket Number:
 

goodmove

Well-Known Member
May 12, 2003
643
4
168
If you just want to empty the msglog and input directories (leaving the actual directories in tact) you can use this:

rm -f /var/spool/exim/msglog/*

rm -f /var/spool/exim/input/*
 

WebHostPro

Well-Known Member
PartnerNOC
Jul 28, 2002
1,727
28
328
LA, Costa RIca
cPanel Access Level
Root Administrator
Twitter
I did this: rm -f /var/spool/exim/input/*

And got this: -bash: /bin/rm: Argument list too long

I do this: rm -f /var/spool/exim/msglog/*

And get this: -bash: /bin/rm: Argument list too long

Is this what it was sapposed to do?

Thanks, Charles

cPanel.net Support Ticket Number:
 

jamesbond

Well-Known Member
Oct 9, 2002
737
1
168
Originally posted by DWHS.net
I did this: rm -f /var/spool/exim/input/*

And got this: -bash: /bin/rm: Argument list too long

I do this: rm -f /var/spool/exim/msglog/*

And get this: -bash: /bin/rm: Argument list too long

Is this what it was sapposed to do?

Thanks, Charles

cPanel.net Support Ticket Number:
I think that means you have too many files in those directories.

Maybe you could check somehow if there is a certain pattern in filenames and start deleting them by in steps by doing this for example

rm -f /var/spool/exim/input/11*
rm -f /var/spool/exim/input/12*
rm -f /var/spool/exim/input/13*

cPanel.net Support Ticket Number:
 

WebHostPro

Well-Known Member
PartnerNOC
Jul 28, 2002
1,727
28
328
LA, Costa RIca
cPanel Access Level
Root Administrator
Twitter
That's what I thought to...

Hmmmm, Delete in steps sound good Bond.

Since I am not familiar with these commands, what is the command to delete say 100 at a time?

and sorry but do you know what command shows how many files are in a folder when your in there. I tried ls and after 20 minites it still didn't show, so I stopped it.

I will try it again unless there is a easy way to list how many files are in ther without running a ls.

:)

cPanel.net Support Ticket Number:
 

jamesbond

Well-Known Member
Oct 9, 2002
737
1
168
Originally posted by DWHS.net
That's what I thought to...

Hmmmm, Delete in steps sound good Bond.

Since I am not familiar with these commands, what is the command to delete say 100 at a time?

and sorry but do you know what command shows how many files are in a folder when your in there. I tried ls and after 20 minites it still didn't show, so I stopped it.

I will try it again unless there is a easy way to list how many files are in ther without running a ls.

:)

If you have other cpanel servers just look in those directories to see what pattern the filenames have. And then delete them the way I mentioned before.

Or do what Bdraco mentioned in a similar thread


create a shell script with the following lines and execute it.

cd /var/spool/exim/input
for file in *
do
rm -fv $file
done

I haven't tried this myself.
Before running it make sure you specified the correct path in the script, since this will otherwise delete all the files in the directory you're in.

cPanel.net Support Ticket Number:
 

jamesbond

Well-Known Member
Oct 9, 2002
737
1
168
Originally posted by DWHS.net
Do you think I can delete the folder and re-create it without probs?
I guess you could do that, make sure you set the same permissions on the directory after recreating it.
Maybe it's better you also stop exim while doing this and start it again afterwards.

cPanel.net Support Ticket Number:
 

Silverado

Well-Known Member
Mar 19, 2003
153
0
166
Backyard - Poolside
if you will just use rm -rf /var/spool/exim/input/ it will wipe out everything in there... and your folder will still be there. I use it every day.. :D

cPanel.net Support Ticket Number:
 

Silverado

Well-Known Member
Mar 19, 2003
153
0
166
Backyard - Poolside
Strange indeed. I run that command weekly on all my servers to remove most of the stale mail that the cron jobs just don't pick up.
You could try it without the final / behind input.
Sometimes you may have to run it twice.... give me a few minutes and I will give you another cool program that works like FTP and you can navigate to the folder or any other and delete them that way.

cPanel.net Support Ticket Number: