Sponsored Content
Top Forums Shell Programming and Scripting Email alert after termination Post 303003863 by Corona688 on Thursday 21st of September 2017 03:12:39 PM
Old 09-21-2017
The email gets sent once 'script' terminates because shell scripts run one line at a time.

Emails include a time by definition.
This User Gave Thanks to Corona688 For This Post:
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Email alert script

I need to code a script, which will run via cron, every 30 minutes. The script will read a file containing a date&time and number (which represents disk space). The file gets appended to every 30 minutes. Here's a sample of the file: CPU 1:04/25/02 1:00 am:1972554 CPU 1:04/25/02 1:30... (1 Reply)
Discussion started by: moon
1 Replies

2. Shell Programming and Scripting

email Alert

Hello, I want a script that will scan the file /etc/httpd/conf/httpd.conf and the folder /etc/httpd/libexec/ -bash-2.05b# grep mod_r /etc/httpd/conf/httpd.conf LoadModule rewrite_module libexec/mod_rewrite.so AddModule mod_rewrite.c -bash-2.05b# -bash-2.05b# find... (4 Replies)
Discussion started by: fed.linuxgossip
4 Replies

3. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

4. UNIX for Beginners Questions & Answers

Email Alert in UNIX

Hi There I have to wrote a script where I am able to echo a result of an SQL script, however I want to be able to send an email to myself when it is more than 0 (so whenever a value is returned) is this possible? I tried one way from looking on the web but this didn't work, I have added my... (8 Replies)
Discussion started by: simpsa27
8 Replies
explain_exit(3) 					     Library Functions Manual						   explain_exit(3)

NAME
explain_exit - print an explanation of exit status before exiting SYNOPSIS
#include <libexplain/libexplain.h> void explain_exit_on_exit(void); void explain_exit_on_error(void); void explain_exit_cancel(void); DESCRIPTION
The explain_exit_on_exit function may be used to have the calling program print an explanation of its exit status (the value passed to exit(3) or the return value from main) immediately before it terminates. The explain_exit_on_error function may be used to have the calling program print an explanation of its exit status immediately before it terminates, if that exit status is not EXIT_SUCCESS. The explain_exit_cancel function may be used to cancel the effect of the explain_exit_on_exit or explain_exit_on_error function. These functions may be called multiple times, and in any order. The last called has precedence. The explanation will never be printed more than once. Call Exit As Normal In order to have the explanation printed, simply call exit(3) as normal, or return from main as normal. Do not call any of these functions in order to exit your program, they are called before you exit your program. Caveat This functionality is only available on systems with the on_exit(3) system call. Unfortunately, the atexit(3) system call is not suffi- ciently capable, as it does not pass the exit status to the registered function. SEE ALSO
exit(3) cause normal process termination atexit(3) register a function to be called at normal process termination on_exit(3) register a function to be called at normal process termination COPYRIGHT
libexplain version 0.52 Copyright (C) 2009 Peter Miller AUTHOR
Written by Peter Miller <pmiller@opensource.org.au> explain_exit(3)
All times are GMT -4. The time now is 06:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy