Help with consolidating mails sent by executing script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with consolidating mails sent by executing script
# 1  
Old 07-03-2014
Help with consolidating mails sent by executing script

I have a script which checks for swap usage of the unix server.
A cron job has been created to execute this script every hour and send the output via mail.

This output is only required for a particular duration and it can range anywhere from 6 hours to 10 hours. So we are commenting out the cron entry whenever it is not required.

Is there a way by which I can get all these hourly mails consolidated into a single mail? Smilie

Thanks in advance.
# 2  
Old 07-03-2014
Easiest is prepare a file with all these outputs and and send it across as mail at the final time.

Remove the mail functionality from your script and create a new script to mail which accept file as input and sends mail. Now

- schedule your original script every hour which will keep appending file.
- schedule the another script at the end of the day or your choice of time to send the mail.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Consolidating multiple outputs in one file

Dears, i am stuck here i have 3 scripts running at one time and all the three scripts finish at different time and each script generate 1 file with different name. so i will have three files. i dnt know which script finish first i want to have a script which check if all the there files are... (6 Replies)
Discussion started by: mirwasim
6 Replies

2. Shell Programming and Scripting

Format data by consolidating replicated obs

Please assist with the following. I have readings R1, R2,..Rn from plants from different fields , sometimes replicated. I need to first consolidate the replicates by their mean value per plant per field. Then I need to reformat the data by partially transposing it. The missing values... (3 Replies)
Discussion started by: jianp83
3 Replies

3. Shell Programming and Scripting

Mails from shell script

Hello Gurus, I am facing some issues while doing the automation of some progs. The requirement is if any prog fails with error automatically the script will send alert for such failed progs. Below is the table structure:- PROG_NAME Description... (1 Reply)
Discussion started by: pokhraj_d
1 Replies

4. Shell Programming and Scripting

Script for count files and send mails

Hi. I'm new on this forum and I need if possible someone to help me with one script. The script should act like this: - should be run by crontab and have next parameters: script_name $par1 $par2 $par3 $par4 where script will search in dir $par1 for files with mask $par2 and if number of... (2 Replies)
Discussion started by: atrailm
2 Replies

5. UNIX for Advanced & Expert Users

Sendmail Script don't deliver mails

Hi, i've got a problem with a sendmail script, which sends HTML mails. Some mail will rejected by the mail server, because the fqdn doesn't exist. Where can i set the sender-domainname by sendmail? My mail server say: "Sender address rejected: Domain not found;", which is correct... (3 Replies)
Discussion started by: rainbowwarrior
3 Replies

6. Shell Programming and Scripting

Script to consolidate files as mails,groupid

Hi, I'm newbie in Bash scripting. Here is scenario I've a file which containslist of 100 mailgroup and in a directory i have 100 files with each group's respective mail addresses. I'd like to make one CSV file with this information as follows. consolidated files with mailid,groupname. ... (7 Replies)
Discussion started by: manish123456
7 Replies

7. Windows & DOS: Issues & Discussions

Consolidating Freespace to allow shrinking partition?

i have an "old" laptop with 84gb used space, 203gb free, running 32bit Windows Vista. i've tried all defragmenting programs i could find and though some offer Free Space Defrag, they don't seem to take into account where on the disk to consolidates the space to. what i am trying to achieve is... (4 Replies)
Discussion started by: Sterist
4 Replies

8. UNIX for Dummies Questions & Answers

Script to delete mails from maildir

Hi buddies, Anybody has any script to delete mails from Maildir/cur??? I mean is it possible to delete mails from Maildir/cur matching a particular subject like spam or fax??? Thanks in advance (1 Reply)
Discussion started by: squid04
1 Replies

9. UNIX for Advanced & Expert Users

Consolidating Pipes

This is something I've given a lot of thought to and come up with no answer. Say you have a data stream passing from a file, through process A, into process B. Process A only modifies a few bytes of the stream, then prints the rest of the stream unmodified. Is there any way to stream the file... (4 Replies)
Discussion started by: Corona688
4 Replies

10. Shell Programming and Scripting

Adding values then consolidating lines

I'm a begginer with scripting... Have a script that pulls check information data. There are multiple lines for each check. ALL the info is the same on the line EXCEPT the charges. ie: same check number, same payee, same patient, same check date, DIFFERENT CHARGE. I need to total the charges... (0 Replies)
Discussion started by: tdavenpo
0 Replies
Login or Register to Ask a Question