Sponsored Content
Full Discussion: Email Alerts
Top Forums UNIX for Dummies Questions & Answers Email Alerts Post 302342498 by Smiling Dragon on Monday 10th of August 2009 04:02:01 AM
Old 08-10-2009
You can add the following line to your script to send emails:
Code:
echo "Here is some text" | /usr/bin/mailx -s "some subject line" me@mydomain.com

If you only need to know when it's finished and don't care about the success or failure, the above line at the end of the script will work.

If you want more info or smarts, you can wrap some logic around your perl /appcfg/... lines to see if they exit OK (exit code = 0) or an error (exit code != 0) and make the appropriate action accordingly.

However, cron has some builtin smarts that will have it email the owner of the job automatically if it produces any output and remain silent if not. It could be sufficient to just have clean.pl produce output if it hits an issue.
Or if you just need a notification, end your script with:
Code:
echo "done at `date`"

Or something like that...
 

10 More Discussions You Might Find Interesting

1. IP Networking

Email Alerts

Dear Network Masters, I want to know who brought up the concept of Email Alerts Feature. are their any RFC's on Email Alerts???? Please let me know. Thanks in Adv, meti (1 Reply)
Discussion started by: ashokmeti
1 Replies

2. Solaris

configure solaris 10 mail to relay email alerts from SAN switch

I want to be able to use an account on a solaris 10 server, eg root@myhost to act as a relay to forward mail to my domain account me@mycompany.com The reason for this is to configure root@myhost as a mail relay on Brocade SAN switches - so that when a port goes bad i get an email alert.... (0 Replies)
Discussion started by: wibidee
0 Replies

3. AIX

email alerts for memory or cpu exceeding thresholds

Hi Guys, I hope this is an easy question: I need some kind of script or an idea how I can convince syslog to send an email to root or someone else once cpu usage exceeds 95% or the memory consumption (maybe via AVM value times 4k) exceeds 85% of my real memory on any of my 700 lpars. We're... (4 Replies)
Discussion started by: zxmaus
4 Replies

4. Shell Programming and Scripting

df -k Alerts

Hi - I would like to send an e-mail alerts if in the output below capacity reaches to 80% and 90% df -k /d500/oracle /d905/oracle /d805/oracle /d705/oracle Filesystem kbytes used avail capacity Mounted on /dev/vx/dsk/abcde_raid5_db/d500 52428800... (1 Reply)
Discussion started by: niraj_bhatt
1 Replies

5. Shell Programming and Scripting

Logic to send email alerts only 5 times a day

Hi, I have written below disk space monitoring script to monitor disk space every minute. I have scheduled this script through cron. But now my problem is this script alerts the users continuously until the space is freed up. These emails are filling up the inbox exponentially until the space... (3 Replies)
Discussion started by: svajhala
3 Replies

6. Solaris

ALOM Email Alerts

Hi I'm new to this forum and I was hoping you can help me with this strange activity. I have a Sol10 sun4u sparc SunFireV250 machine. Currently running ALOM 1.6.8 firmware. The following error was experienced on this machine: "Input power unavailable for PSU @ PS0" Reading the documention... (0 Replies)
Discussion started by: La-Paloma78
0 Replies

7. Shell Programming and Scripting

Email alerts whenever someone logs into server via SSH any user?

Hi all, Thanks in Advance!! I dont know how to start to write script for this process, my requirement is if any user logs into server automatically Admin get mail alert. how is this possible? any one guide me to complete this process. (1 Reply)
Discussion started by: anishkumarv
1 Replies

8. AIX

Will it affect my AIX LPAR security, when i set up email alerts on AIX server.

Hello, I've set up email alerts on AIX Servers. so that i can get email notifications (via mail relay server) when ever there is abnormal behavior. for example 1) my script monitors CPU/disk/memory etc... when it reaches high water ark, it will send an email alert. 2) disk usage alerts 3)... (5 Replies)
Discussion started by: System Admin 77
5 Replies

9. AIX

Would like to get email alerts when user password going to expire

Hello, I am trying to write a shell script, which will send email alerts to Admin/users when users password is going to expire in 15 days. Can you please help me with the script. thank you. (3 Replies)
Discussion started by: Kumar7997
3 Replies

10. UNIX for Dummies Questions & Answers

Send email attachment using Operating System Script(UNIX) in Oracle Alerts

Good Day Kindly assist: I am creating an Alert that will notify supervisors of staff members who are due for probation report. I am using Operating System Script(Unix) as source.I have already developed the script. Now the challenge is if there are 3 employee records then the alert... (2 Replies)
Discussion started by: nosi27
2 Replies
queuedefs(4)							   File Formats 						      queuedefs(4)

NAME
queuedefs - queue description file for at, batch, and cron SYNOPSIS
/etc/cron.d/queuedefs DESCRIPTION
The queuedefs file describes the characteristics of the queues managed by cron(1M). Each non-comment line in this file describes one queue. The format of the lines are as follows: q.[njobj][nicen][nwaitw] The fields in this line are: q The name of the queue. a is the default queue for jobs started by at(1); b is the default queue for jobs started by batch (see at(1)); c is the default queue for jobs run from a crontab(1) file. njob The maximum number of jobs that can be run simultaneously in that queue; if more than njob jobs are ready to run, only the first njob jobs will be run, and the others will be run as jobs that are currently running terminate. The default value is 100. nice The nice(1) value to give to all jobs in that queue that are not run with a user ID of super-user. The default value is 2. nwait The number of seconds to wait before rescheduling a job that was deferred because more than njob jobs were running in that job's queue, or because the system-wide limit of jobs executing has been reached. The default value is 60. Lines beginning with # are comments, and are ignored. EXAMPLES
Example 1: A sample file. # # a.4j1n b.2j2n90w This file specifies that the a queue, for at jobs, can have up to 4 jobs running simultaneously; those jobs will be run with a nice value of 1. As no nwait value was given, if a job cannot be run because too many other jobs are running cron will wait 60 seconds before trying again to run it. The b queue, for batch(1) jobs, can have up to 2 jobs running simultaneously; those jobs will be run with a nice(1) value of 2. If a job cannot be run because too many other jobs are running, cron(1M) will wait 90 seconds before trying again to run it. All other queues can have up to 100 jobs running simultaneously; they will be run with a nice value of 2, and if a job cannot be run because too many other jobs are running cron will wait 60 seconds before trying again to run it. FILES
/etc/cron.d/queuedefs queue description file for at, batch, and cron. SEE ALSO
at(1), crontab(1), nice(1), cron(1M) SunOS 5.10 1 Mar 1994 queuedefs(4)
All times are GMT -4. The time now is 09:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy