The shell expands that * into a list of filenames and then tries to run the rm command with that list. But there's a limit to how long that list can be and you exceeded it.
Since you are using the full path, you might try a relative path instead:
Now each individual file no longer has the /var/spool/mqueue/ prefix so the expanded command is much shorter. But if this is still too long, you can try this...
The ls produces a list of file names which xargs reads. It then assembles them into a bunch of rm commands. It knows how long each one can be and it won't assemble a command that is too long.
But are sure that you want to do this? You are going to discard all of your mail! My idea of clearing the queue is
Last edited by rbatte1; 11-17-2016 at 10:59 AM..
Reason: Added CODE tags
Hi shell experts,
I would like to have a shell script running in a redhat server for monitoring the mailqueue status. I have already installed the qmHandle and I am using it to get a status of the mail queue in daily basis. I am executing the qmhandle in the cron.
Now I am planning to execute... (10 Replies)
Hi,
I have some problems w/ the sendmail. I see that messages are queued in the /var/spool/mqueue
and they are never sent to the recipients. This problem just suddenly started without any modifications in the current configuration. I already started and stop the sendmail and it did not help.... (3 Replies)
hi all.
Am using smtpd_recipient_restrictions & check_recipient_access in postfix.
The hash file looks like this:
emailaddress1 HOLD
emailaddress2 HOLD
The aim is to place email from these recipients in the hold directory,check them then reinject them back in postfix on some... (0 Replies)
HI admins,
I am not able to clear pvid .I am getting below error.
chdev -l hdisk273 -a pv=clear
Method error (/usr/lib/methods/chgdisk):
0514-047 Cannot access a device.
pv
The disk is from SAN. I can clear remove the disk using rmdev.But if i run cfgmgr , this disk apperas... (2 Replies)
Hello
I'm using Cent OS6 and a webmin interface
I've had an issue where over 1 million emails were queued in the sendmail mail queue. I found a thread on here from 2002 explaining how to delete them all and it worked great.
Thanks Perderabu
unix-for-dummies-questions-and-answers /... (0 Replies)
I know the command mailq can check the pending mail in mqueue , and also have another command to check POSIX mail queue in server , now I will regularly check the mqueue manually , it is time consuming , would advise the script that could help to check the mail queue , and then send the details to... (3 Replies)
We use Redhat server , we always use mailq to check any pending mail in mailq , when run the command mailq , it shows all existing pending mail would advise how to write a script to show the pending mails which are older than 24 hours , ( if possible , then send this pending mail info to... (9 Replies)
Hi
I have installed an HP X451dw printer on our network and want to print from Sco Openserver v6
The printer produces correct output but then repeats until the queue is manually stopped. :confused:
It is using a netcat/dumb interface
Any advice on how to persuade it to only print once... (5 Replies)