I am trying to write a bash e-mailer script on a host that has a bunch of CPUs and makes use of all of them. It e-mails a huge list of people, so I wanna save time running this script if I can.
What e-mails it does send get sent concurrently, but most don't get sent at all.
There is a serial version of this script that definitely sends out more e-mails.
I'm wondering if those running sendmail are blocking others from running sendmail on the same CPU?
Is there any particular reason they need to be sent simultaneously? All it ought to be doing is putting them in the queue, so there wouldn't be an enormous delay from running it one-at-a-time.
assuming that sendmail -t $tmp does work to send email. I do not see where the $uid variable gets used to address email. Oh well.
bash or ksh example using your code fragment:
This sends 15 at one pass. You may have exceeded resource limits trying to send hundreds of emails at one time. I agree with corona -sometimes we have requirements that are there for a really poor reasons. Why is there a major time constraint on this job? Or are you simply learning how to do this?
Last edited by jim mcnamara; 10-01-2012 at 11:32 PM..
This User Gave Thanks to jim mcnamara For This Post:
What I put is not actual code, I just wrote that to give you guys an idea of what I'm trying to do. The code I did show was not copied verbatim. I apologize for the confusion.
I will give Jim's code a try.
---------- Post updated at 08:59 PM ---------- Previous update was at 08:20 PM ----------
I found out how to get the # of CPU. I guess if one of the CPUs happen to be too busy, then an e-mail may not get sent?
---------- Post updated at 09:04 PM ---------- Previous update was at 08:59 PM ----------
Was able to reduce the runtime from 30min to 6min, looks like all e-mails got sent. It checks to see how many CPUs the host has then tries to do a sendmail on each of them I imagine.
I found out how to get the # of CPU. I guess if one of the CPUs happen to be too busy, then an e-mail may not get sent?
No. That has nothing to do with it. Any UNIX system can multitask.
Quote:
Was able to reduce the runtime from 30min to 6min, looks like all e-mails got sent. It checks to see how many CPUs the host has then tries to do a sendmail on each of them I imagine.
It has more to do with how much RAM your user is allowed to use, or how many simultaneous processes you're allowed to create, than how many CPU's you have. Having your script limit itself in any fashion would and did help.
Your script is probably slow for reasons other than sendmail. If you're new to shell, there may be some simple things turned inside out. Post it and we can help.
Last edited by Corona688; 10-03-2012 at 02:16 PM..
I'm not sure I remember things correctly, but what about creating "mailing lists" with sth. like a dummy address in aliases and send all the mails in one go?
Hi all,
I am using a Solaris 10 machine as SMTP server. All MAILER-DAEMON mails that are not delivered are getting stuck in /var/spool/mqueue .
Is there any way to DISCARD/DROP/DELETE such mails automatically so that they don't pile up in my queue ?
regards (1 Reply)
What is the difference betweeen MAILX and SENDMAIL. I have SENDMAIL configured in my system, how is it different then MAILX, espicially in the syntax of sending mail from the command line.
Thanks in advance (3 Replies)
Hi..
I am using HP UX 11.0
i want to make automated back up from SAM back up tool....
so i mentioned the file systems and back up device /dev/rmt/0m and time 0:00 and days of the week........
but it was not successful.....the back up job was not started on specified time.....
i am in... (7 Replies)