Friends,
I am in search for a shell script that is capable of running as a cronjob and have to send out an email when ever there is a CORE DUMP.
Please post the hints to achieve my goal.
Thanks in advance. (1 Reply)
Hi All,
I have a have a script which checks for some processes whether they are running or not and if they are not running then it send a mail specifying that the processes are not running.
This particular script example abc.ksh is runs in a cron like this
0,5,10,15,20,25,30,35,40,45,50,55 * * *... (5 Replies)
I have a script like this, which calls other scripts from that script:
#!/usr/ksh
moveFiles.sh
extract.sh
readfile=/home/sample.txt
cat $readfile | while read line
do
file= `echo $line|awk '{print $4}'`
if ;
then mv $file /home/temp_stage
fi (4 Replies)
Hello Team,
I have script which gives below output.
Server clustServer11 is in a STARTED state
Server clustServer12 is in a STOPPED state
Server clustServer21 is in a STOPPED state
I would like to prepare script which will grep stop word from the above output and send an email alert. (5 Replies)
I have an issue with one of the processes which is showing %cpu over 120% when i issue the top command. I am looking for a script that send me an email alert when it crosses the 90% thresholds.
Appreciate your help (1 Reply)
Hi Experts,
Is it possible to send ctrl + d signal from a inside a file made with vi, using Ctrl V , Esc and 004 , escape sequence.
Since : 004 should exit the script if executed. Is this something possible.
I am trying with vi , I put this code ^ , and trying to execute it but... (4 Replies)
I am trying to accomplish following tasks in my KSH script:
Run a sql script on multiple $ORACLE_SID at once
Sends an alert only if the threshold > 2 for any of the $ORACLE_SID
Please advice as to how I can approach this!!
Thanks in advance! (1 Reply)
HI Guys,
I am writing one shell script to send the mail alert to some email id's if the file not modified in last 10 mins but its not working, I believe MTIME is null string is wrong . can you please assist me on this.
script :-
filename="abc.txt"
echo "Filename is $filename"... (1 Reply)
Hi
I have below shell script to send mail alert , however I want to add more functionality in this script and that is , script should only check that file between 9 am to 5pm , and if there is no activity in this time 9 am to 5 pm for 2hours then it should give me mail alert, please help... (2 Replies)
Discussion started by: scazed
2 Replies
LEARN ABOUT NETBSD
cron
CRON(8) BSD System Manager's Manual CRON(8)NAME
cron -- daemon to execute scheduled commands (ISC Cron V4.1)
SYNOPSIS
cron [-n] [-x debugflags]
DESCRIPTION
cron is normally started during system boot by rc.d(8) framework, if cron is switched on in rc.conf(5).
It will return immediately so you don't have to start it with '&'.
cron searches /var/cron/tabs for crontab files which are named after accounts in /etc/passwd. Crontabs found are loaded into memory. cron
also searches for /etc/crontab which is in a different format (see crontab(5)). Finally cron looks for crontabs in /etc/cron.d if it exists,
and executes each file as a crontab.
When cron looks in a directory for crontabs (either in /var/cron/tabs or /etc/cron.d) it will not process files that:
- Start with a '.' or a '#'.
- End with a '~' or with ``.rpmsave'', ``.rpmorig'', or ``.rpmnew''.
- Are of zero length.
- Their length is greater than MAXNAMLEN.
cron then wakes up every minute, examining all stored crontabs, checking each command to see if it should be run in the current minute. When
executing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab,
if such exists).
Events such as START and FINISH are recorded in the /var/log/cron log file with date and time details. This information is useful for a num-
ber of reasons, such as determining the amount of time required to run a particular job. By default, root has an hourly job that rotates
these log files with compression to preserve disk space.
Additionally, cron checks each minute to see if its spool directory's modtime (or the modtime on /etc/crontab or /etc/cron.d) has changed,
and if it has, cron will then examine the modtime on all crontabs and reload those which have changed. Thus cron need not be restarted when-
ever a crontab file is modified. Note that the crontab(1) command updates the modtime of the spool directory whenever it changes a crontab.
The following options are available:
-x This flag turns on some debugging flags. debugflags is comma-separated list of debugging flags to turn on. If a flag is turned on,
cron writes some additional debugging information to system log during its work. Available debugging flags are:
sch scheduling
proc process control
pars parsing
load database loading
misc miscellaneous
test test mode - do not actually execute any commands
bit show how various bits are set (long)
ext print extended debugging information
-n Stay in the foreground and don't daemonize cron.
Daylight Saving Time and other time changes
Local time changes of less than three hours, such as those caused by the start or end of Daylight Saving Time, are handled specially. This
only applies to jobs that run at a specific time and jobs that are run with a granularity greater than one hour. Jobs that run more fre-
quently are scheduled normally.
If time has moved forward, those jobs that would have run in the interval that has been skipped will be run immediately. Conversely, if time
has moved backward, care is taken to avoid running jobs twice.
Time changes of more than 3 hours are considered to be corrections to the clock or timezone, and the new time is used immediately.
SIGNALS
On receipt of a SIGHUP, the cron daemon will close and reopen its log file. This is useful in scripts which rotate and age log files. Natu-
rally this is not relevant if cron was built to use syslog(3).
FILES
/var/cron/tabs cron spool directory
/etc/crontab system crontab file
/etc/cron.d/ system crontab directory
/var/log/cron log file for cron events
SEE ALSO crontab(1), crontab(5)AUTHORS
Paul Vixie <vixie@isc.org>
BSD October 12, 2011 BSD